!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Sailthru",[],t):"object"==typeof exports?exports.Sailthru=t():e.Sailthru=t()}(self,()=>(()=>{"use strict";var e={169:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{}class n extends r{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class i extends r{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class s extends r{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class o extends r{}class a extends r{constructor(e){super(`Invalid unit ${e}`)}}class u extends r{}class l extends r{constructor(){super("Zone is an abstract class")}}const c="numeric",d="short",h="long",m={year:c,month:c,day:c},f={year:c,month:d,day:c},y={year:c,month:d,day:c,weekday:d},p={year:c,month:h,day:c},g={year:c,month:h,day:c,weekday:h},w={hour:c,minute:c},v={hour:c,minute:c,second:c},b={hour:c,minute:c,second:c,timeZoneName:d},k={hour:c,minute:c,second:c,timeZoneName:h},S={hour:c,minute:c,hourCycle:"h23"},x={hour:c,minute:c,second:c,hourCycle:"h23"},T={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:d},O={hour:c,minute:c,second:c,hourCycle:"h23",timeZoneName:h},I={year:c,month:c,day:c,hour:c,minute:c},C={year:c,month:c,day:c,hour:c,minute:c,second:c},N={year:c,month:d,day:c,hour:c,minute:c},E={year:c,month:d,day:c,hour:c,minute:c,second:c},$={year:c,month:d,day:c,weekday:d,hour:c,minute:c},D={year:c,month:h,day:c,hour:c,minute:c,timeZoneName:d},V={year:c,month:h,day:c,hour:c,minute:c,second:c,timeZoneName:d},M={year:c,month:h,day:c,weekday:h,hour:c,minute:c,timeZoneName:h},_={year:c,month:h,day:c,weekday:h,hour:c,minute:c,second:c,timeZoneName:h};class L{get type(){throw new l}get name(){throw new l}get ianaName(){return this.name}get isUniversal(){throw new l}offsetName(e,t){throw new l}formatOffset(e,t){throw new l}offset(e){throw new l}equals(e){throw new l}get isValid(){throw new l}}let U=null;class F extends L{static get instance(){return null===U&&(U=new F),U}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return nt(e,t,r)}formatOffset(e,t){return at(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const q=new Map;const P={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const A=new Map;class j extends L{static create(e){let t=A.get(e);return void 0===t&&A.set(e,t=new j(e)),t}static resetCache(){A.clear(),q.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=j.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return nt(e,t,r,this.name)}formatOffset(e,t){return at(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=function(e){let t=q.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),q.set(e,t)),t}(this.name);let[n,i,s,o,a,u,l]=r.formatToParts?function(e,t){const r=e.formatToParts(t),n=[];for(let e=0;e=0?d:1e3+d,(Qe({year:n,month:i,day:s,hour:24===a?0:a,minute:u,second:l,millisecond:0})-c)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let z={};const W=new Map;function R(e,t={}){const r=JSON.stringify([e,t]);let n=W.get(r);return void 0===n&&(n=new Intl.DateTimeFormat(e,t),W.set(r,n)),n}const Z=new Map;const H=new Map;let B=null;const Y=new Map;function G(e){let t=Y.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Y.set(e,t)),t}const J=new Map;function K(e,t,r,n){const i=e.listingMode();return"error"===i?null:"en"===i?r(t):n(t)}class X{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:i,...s}=r;if(!t||Object.keys(s).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){const r=JSON.stringify([e,t]);let n=Z.get(r);return void 0===n&&(n=new Intl.NumberFormat(e,t),Z.set(r,n)),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return Ze(this.floor?Math.floor(e):Ge(e,3),this.padTo)}}class Q{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&j.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||n,this.dtf=R(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class ee{constructor(e,t,r){this.opts={style:"long",...r},!t&&Pe()&&(this.rtf=function(e,t={}){const{base:r,...n}=t,i=JSON.stringify([e,n]);let s=H.get(i);return void 0===s&&(s=new Intl.RelativeTimeFormat(e,t),H.set(i,s)),s}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",n=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&s){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${i[e][0]}`;case-1:return r?"yesterday":`last ${i[e][0]}`;case 0:return r?"today":`this ${i[e][0]}`}}const o=Object.is(t,-0)||t<0,a=Math.abs(t),u=1===a,l=i[e],c=n?u?l[1]:l[2]||l[1]:u?i[e][0]:e;return o?`${a} ${c} ago`:`in ${a} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const te={firstDay:1,minimalDays:4,weekend:[6,7]};class re{static fromOpts(e){return re.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,i=!1){const s=e||be.defaultLocale,o=s||(i?"en-US":B||(B=(new Intl.DateTimeFormat).resolvedOptions().locale,B)),a=t||be.defaultNumberingSystem,u=r||be.defaultOutputCalendar,l=We(n)||be.defaultWeekSettings;return new re(o,a,u,l,s)}static resetCache(){B=null,W.clear(),Z.clear(),H.clear(),Y.clear(),J.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return re.create(e,t,r,n)}constructor(e,t,r,n,i){const[s,o,a]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=R(e).resolvedOptions(),n=e}catch(i){const s=e.substring(0,r);t=R(s).resolvedOptions(),n=s}const{numberingSystem:i,calendar:s}=t;return[n,i,s]}}(e);this.locale=s,this.numberingSystem=t||o||null,this.outputCalendar=r||a||null,this.weekSettings=n,this.intl=function(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===G(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?re.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,We(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return K(this,e,ht,()=>{const r="ja"===this.intl||this.intl.startsWith("ja-"),n=(t&=!r)?{month:e,day:"numeric"}:{month:e},i=t?"format":"standalone";if(!this.monthsCache[i][e]){const t=r?e=>this.dtFormatter(e,n).format():e=>this.extract(e,n,"month");this.monthsCache[i][e]=function(e){const t=[];for(let r=1;r<=12;r++){const n=wn.utc(2009,r,1);t.push(e(n))}return t}(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return K(this,e,pt,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){const t=[];for(let r=1;r<=7;r++){const n=wn.utc(2016,11,13+r);t.push(e(n))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return K(this,void 0,()=>gt,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[wn.utc(2016,11,13,9),wn.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return K(this,e,kt,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[wn.utc(-40,1,1),wn.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){const n=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===r);return n?n.value:null}numberFormatter(e={}){return new X(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Q(e,this.intl,t)}relFormatter(e={}){return new ee(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const r=JSON.stringify([e,t]);let n=z[r];return n||(n=new Intl.ListFormat(e,t),z[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||G(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Ae()?function(e){let t=J.get(e);if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in t||(t={...te,...t}),J.set(e,t)}return t}(this.locale):te}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ne=null;class ie extends L{static get utcInstance(){return null===ne&&(ne=new ie(0)),ne}static instance(e){return 0===e?ie.utcInstance:new ie(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new ie(it(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${at(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${at(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return at(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class se extends L{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function oe(e,t){if(Ue(e)||null===e)return t;if(e instanceof L)return e;if("string"==typeof e){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?F.instance:"utc"===r||"gmt"===r?ie.utcInstance:ie.parseSpecifier(r)||j.create(e)}return Fe(e)?ie.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new se(e)}const ae={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ue={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},le=ae.hanidec.replace(/[\[|\]]/g,"").split("");const ce=new Map;function de({numberingSystem:e},t=""){const r=e||"latn";let n=ce.get(r);void 0===n&&(n=new Map,ce.set(r,n));let i=n.get(t);return void 0===i&&(i=new RegExp(`${ae[r]}${t}`),n.set(t,i)),i}let he,me=()=>Date.now(),fe="system",ye=null,pe=null,ge=null,we=60,ve=null;class be{static get now(){return me}static set now(e){me=e}static set defaultZone(e){fe=e}static get defaultZone(){return oe(fe,F.instance)}static get defaultLocale(){return ye}static set defaultLocale(e){ye=e}static get defaultNumberingSystem(){return pe}static set defaultNumberingSystem(e){pe=e}static get defaultOutputCalendar(){return ge}static set defaultOutputCalendar(e){ge=e}static get defaultWeekSettings(){return ve}static set defaultWeekSettings(e){ve=We(e)}static get twoDigitCutoffYear(){return we}static set twoDigitCutoffYear(e){we=e%100}static get throwOnInvalid(){return he}static set throwOnInvalid(e){he=e}static resetCaches(){re.resetCache(),j.resetCache(),wn.resetCache(),ce.clear()}}class ke{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Se=[0,31,59,90,120,151,181,212,243,273,304,334],xe=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e,t){return new ke("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Oe(e,t,r){const n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const i=n.getUTCDay();return 0===i?7:i}function Ie(e,t,r){return r+(Je(e)?xe:Se)[t-1]}function Ce(e,t){const r=Je(e)?xe:Se,n=r.findIndex(e=>ett(n,t,r)?(u=n+1,l=1):u=n,{weekYear:u,weekNumber:l,weekday:a,...ut(e)}}function $e(e,t=4,r=1){const{weekYear:n,weekNumber:i,weekday:s}=e,o=Ne(Oe(n,1,t),r),a=Ke(n);let u,l=7*i+s-o-7+t;l<1?(u=n-1,l+=Ke(u)):l>a?(u=n+1,l-=Ke(n)):u=n;const{month:c,day:d}=Ce(u,l);return{year:u,month:c,day:d,...ut(e)}}function De(e){const{year:t,month:r,day:n}=e;return{year:t,ordinal:Ie(t,r,n),...ut(e)}}function Ve(e){const{year:t,ordinal:r}=e,{month:n,day:i}=Ce(t,r);return{year:t,month:n,day:i,...ut(e)}}function Me(e,t){if(!Ue(e.localWeekday)||!Ue(e.localWeekNumber)||!Ue(e.localWeekYear)){if(!Ue(e.weekday)||!Ue(e.weekNumber)||!Ue(e.weekYear))throw new o("Cannot mix locale-based week fields with ISO-based week fields");return Ue(e.localWeekday)||(e.weekday=e.localWeekday),Ue(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Ue(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function _e(e){const t=qe(e.year),r=Re(e.month,1,12),n=Re(e.day,1,Xe(e.year,e.month));return t?r?!n&&Te("day",e.day):Te("month",e.month):Te("year",e.year)}function Le(e){const{hour:t,minute:r,second:n,millisecond:i}=e,s=Re(t,0,23)||24===t&&0===r&&0===n&&0===i,o=Re(r,0,59),a=Re(n,0,59),u=Re(i,0,999);return s?o?a?!u&&Te("millisecond",i):Te("second",n):Te("minute",r):Te("hour",t)}function Ue(e){return void 0===e}function Fe(e){return"number"==typeof e}function qe(e){return"number"==typeof e&&e%1==0}function Pe(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Ae(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function je(e,t,r){if(0!==e.length)return e.reduce((e,n)=>{const i=[t(n),n];return e&&r(e[0],i[0])===e[0]?e:i},null)[1]}function ze(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function We(e){if(null==e)return null;if("object"!=typeof e)throw new u("Week settings must be an object");if(!Re(e.firstDay,1,7)||!Re(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!Re(e,1,7)))throw new u("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Re(e,t,r){return qe(e)&&e>=t&&e<=r}function Ze(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function He(e){return Ue(e)||null===e||""===e?void 0:parseInt(e,10)}function Be(e){return Ue(e)||null===e||""===e?void 0:parseFloat(e)}function Ye(e){if(!Ue(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Ge(e,t,r="round"){const n=10**t;switch(r){case"expand":return e>0?Math.ceil(e*n)/n:Math.floor(e*n)/n;case"trunc":return Math.trunc(e*n)/n;case"round":return Math.round(e*n)/n;case"floor":return Math.floor(e*n)/n;case"ceil":return Math.ceil(e*n)/n;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function Je(e){return e%4==0&&(e%100!=0||e%400==0)}function Ke(e){return Je(e)?366:365}function Xe(e,t){const r=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?Je(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Qe(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function et(e,t,r){return-Ne(Oe(e,1,t),r)+t-1}function tt(e,t=4,r=1){const n=et(e,t,r),i=et(e+1,t,r);return(Ke(e)-n+i)/7}function rt(e){return e>99?e:e>be.twoDigitCutoffYear?1900+e:2e3+e}function nt(e,t,r,n=null){const i=new Date(e),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);const o={timeZoneName:t,...s},a=new Intl.DateTimeFormat(r,o).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return a?a.value:null}function it(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function st(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new u(`Invalid unit value ${e}`);return t}function ot(e,t){const r={};for(const n in e)if(ze(e,n)){const i=e[n];if(null==i)continue;r[t(n)]=st(i)}return r}function at(e,t){const r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ze(r,2)}:${Ze(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${Ze(r,2)}${Ze(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ut(e){return function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(e,["hour","minute","second","millisecond"])}const lt=["January","February","March","April","May","June","July","August","September","October","November","December"],ct=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dt=["J","F","M","A","M","J","J","A","S","O","N","D"];function ht(e){switch(e){case"narrow":return[...dt];case"short":return[...ct];case"long":return[...lt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const mt=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ft=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],yt=["M","T","W","T","F","S","S"];function pt(e){switch(e){case"narrow":return[...yt];case"short":return[...ft];case"long":return[...mt];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const gt=["AM","PM"],wt=["Before Christ","Anno Domini"],vt=["BC","AD"],bt=["B","A"];function kt(e){switch(e){case"narrow":return[...bt];case"short":return[...vt];case"long":return[...wt];default:return null}}function St(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const xt={D:m,DD:f,DDD:p,DDDD:g,t:w,tt:v,ttt:b,tttt:k,T:S,TT:x,TTT:T,TTTT:O,f:I,ff:N,fff:D,ffff:M,F:C,FF:E,FFF:V,FFFF:_};class Tt{static create(e,t={}){return new Tt(e,t)}static parseFormat(e){let t=null,r="",n=!1;const i=[];for(let s=0;s0||n)&&i.push({literal:n||/^\s+$/.test(r),val:""===r?"'":r}),t=null,r="",n=!n):n||o===t?r+=o:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=o,t=o)}return r.length>0&&i.push({literal:n||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return xt[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,r=void 0){if(this.opts.forceSimple)return Ze(e,t);const n={...this.opts};return t>0&&(n.padTo=t),r&&(n.signDisplay=r),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,r)=>this.loc.extract(e,t,r),s=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",o=()=>r?function(e){return gt[e.hour<12?0:1]}(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(t,n)=>r?function(e,t){return ht(t)[e.month-1]}(e,t):i(n?{month:t}:{month:t,day:"numeric"},"month"),u=(t,n)=>r?function(e,t){return pt(t)[e.weekday-1]}(e,t):i(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),l=t=>{const r=Tt.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},c=t=>r?function(e,t){return kt(t)[e.year<0?0:1]}(e,t):i({era:t},"era");return St(Tt.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return o();case"d":return n?i({day:"numeric"},"day"):this.num(e.day);case"dd":return n?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return n?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return n?i({month:"numeric"},"month"):this.num(e.month);case"MM":return n?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return n?i({year:"numeric"},"year"):this.num(e.year);case"yy":return n?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(t)}})}formatDurationFromString(e,t){const r="negativeLargestOnly"===this.opts.signMode?-1:1,n=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},i=Tt.parseFormat(t),s=i.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),o=e.shiftTo(...s.map(n).filter(e=>e));return St(i,((e,t)=>i=>{const s=n(i);if(s){const n=t.isNegativeDuration&&s!==t.largestUnit?r:1;let o;return o="negativeLargestOnly"===this.opts.signMode&&s!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(s)*n,i.length,o)}return i})(o,{isNegativeDuration:o<0,largestUnit:Object.keys(o.values)[0]}))}}const Ot=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function It(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Ct(...e){return t=>e.reduce(([e,r,n],i)=>{const[s,o,a]=i(t,n);return[{...e,...s},o||r,a]},[{},null,1]).slice(0,2)}function Nt(e,...t){if(null==e)return[null,null];for(const[r,n]of t){const t=r.exec(e);if(t)return n(t)}return[null,null]}function Et(...e){return(t,r)=>{const n={};let i;for(i=0;ivoid 0!==e&&(t||e&&c)?-e:e;return[{years:h(Be(r)),months:h(Be(n)),weeks:h(Be(i)),days:h(Be(s)),hours:h(Be(o)),minutes:h(Be(a)),seconds:h(Be(u),"-0"===u),milliseconds:h(Ye(l),d)}]}const Zt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ht(e,t,r,n,i,s,o){const a={year:2===t.length?rt(He(t)):He(t),month:ct.indexOf(r)+1,day:He(n),hour:He(i),minute:He(s)};return o&&(a.second=He(o)),e&&(a.weekday=e.length>3?mt.indexOf(e)+1:ft.indexOf(e)+1),a}const Bt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Yt(e){const[,t,r,n,i,s,o,a,u,l,c,d]=e,h=Ht(t,i,n,r,s,o,a);let m;return m=u?Zt[u]:l?0:it(c,d),[h,new ie(m)]}const Gt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Jt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Kt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Xt(e){const[,t,r,n,i,s,o,a]=e;return[Ht(t,i,n,r,s,o,a),ie.utcInstance]}function Qt(e){const[,t,r,n,i,s,o,a]=e;return[Ht(t,a,r,n,i,s,o),ie.utcInstance]}const er=It(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Mt),tr=It(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Mt),rr=It(/(\d{4})-?(\d{3})/,Mt),nr=It(Vt),ir=Ct(function(e,t){return[{year:qt(e,t),month:qt(e,t+1,1),day:qt(e,t+2,1)},null,t+3]},Pt,At,jt),sr=Ct(_t,Pt,At,jt),or=Ct(Lt,Pt,At,jt),ar=Ct(Pt,At,jt);const ur=Ct(Pt);const lr=It(/(\d{4})-(\d\d)-(\d\d)/,Ft),cr=It(Ut),dr=Ct(Pt,At,jt);const hr="Invalid Duration",mr={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},fr={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...mr},yr=365.2425,pr=30.436875,gr={years:{quarters:4,months:12,weeks:52.1775,days:yr,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:pr,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...mr},wr=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],vr=wr.slice(0).reverse();function br(e,t,r=!1){const n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Tr(n)}function kr(e,t){var r;let n=null!=(r=t.milliseconds)?r:0;for(const r of vr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Sr(e,t){const r=kr(e,t)<0?-1:1;wr.reduceRight((n,i)=>{if(Ue(t[i]))return n;if(n){const s=t[n]*r,o=e[i][n],a=Math.floor(s/o);t[i]+=a*r,t[n]-=a*o*r}return i},null),wr.reduce((r,n)=>{if(Ue(t[n]))return r;if(r){const i=t[r]%1;t[r]-=i,t[n]+=i*e[r][n]}return n},null)}function xr(e){const t={};for(const[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}class Tr{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?gr:fr;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||re.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return Tr.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new u("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Tr({values:ot(e,Tr.normalizeUnit),loc:re.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Fe(e))return Tr.fromMillis(e);if(Tr.isDuration(e))return e;if("object"==typeof e)return Tr.fromObject(e);throw new u(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=function(e){return Nt(e,[Wt,Rt])}(e);return r?Tr.fromObject(r,t):Tr.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=function(e){return Nt(e,[zt,ur])}(e);return r?Tr.fromObject(r,t):Tr.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Duration is invalid");const r=e instanceof ke?e:new ke(e,t);if(be.throwOnInvalid)throw new s(r);return new Tr({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new a(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Tt.create(this.loc,r).formatDurationFromString(this,e):hr}toHuman(e={}){if(!this.isValid)return hr;const t=!1!==e.showZeros,r=wr.map(r=>{const n=this.values[r];return Ue(n)||0===n&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(n)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=Ge(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return wn.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?kr(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Tr.fromDurationLike(e),r={};for(const e of wr)(ze(t.values,e)||ze(this.values,e))&&(r[e]=t.get(e)+this.get(e));return br(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=Tr.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=st(e(this.values[r],r));return br(this,{values:t},!0)}get(e){return this[Tr.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return br(this,{values:{...this.values,...ot(e,Tr.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){return br(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Sr(this.matrix,e),br(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return br(this,{values:xr(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>Tr.normalizeUnit(e));const t={},r={},n=this.toObject();let i;for(const s of wr)if(e.indexOf(s)>=0){i=s;let e=0;for(const t in r)e+=this.matrix[t][s]*r[t],r[t]=0;Fe(n[s])&&(e+=n[s]);const o=Math.trunc(e);t[s]=o,r[s]=(1e3*e-1e3*o)/1e3}else Fe(n[s])&&(r[s]=n[s]);for(const e in r)0!==r[e]&&(t[i]+=e===i?r[e]:r[e]/this.matrix[i][e]);return Sr(this.matrix,t),br(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return br(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return br(this,{values:xr(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const r of wr)if(!t(this.values[r],e.values[r]))return!1;return!0}}const Or="Invalid Interval";class Ir{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the Interval is invalid");const r=e instanceof ke?e:new ke(e,t);if(be.throwOnInvalid)throw new i(r);return new Ir({invalid:r})}static fromDateTimes(e,t){const r=vn(e),n=vn(t),i=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Ir.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(vn).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[];let{s:n}=this,i=0;for(;n+this.e?this.e:e;r.push(Ir.fromDateTimes(n,s)),n=s,i+=1}return r}splitBy(e){const t=Tr.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:n}=this,i=1;const s=[];for(;ne*i));r=+e>+this.e?this.e:e,s.push(Ir.fromDateTimes(n,r)),n=r,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e=r?null:Ir.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Ir.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),s=Array.prototype.concat(...i).sort((e,t)=>e.time-t.time);for(const e of s)r+="s"===e.type?1:-1,1===r?t=e.time:(t&&+t!==+e.time&&n.push(Ir.fromDateTimes(t,e.time)),t=null);return Ir.merge(n)}difference(...e){return Ir.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Or}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=m,t={}){return this.isValid?Tt.create(this.s.loc.clone(t),e).formatInterval(this):Or}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Or}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Or}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Or}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Or}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Tr.invalid(this.invalidReason)}mapEndpoints(e){return Ir.fromDateTimes(e(this.s),e(this.e))}}class Cr{static hasDST(e=be.defaultZone){const t=wn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return j.isValidZone(e)}static normalizeZone(e){return oe(e,be.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||re.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||re.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||re.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||re.create(t,r,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||re.create(t,r,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||re.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||re.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return re.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return re.create(t,null,"gregory").eras(e)}static features(){return{relative:Pe(),localeWeek:Ae()}}}function Nr(e,t){const r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(Tr.fromMillis(n).as("days"))}function Er(e,t,r,n){let[i,s,o,a]=function(e,t,r){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=Nr(e,t);return(r-r%7)/7}],["days",Nr]],i={},s=e;let o,a;for(const[u,l]of n)r.indexOf(u)>=0&&(o=u,i[u]=l(e,t),a=s.plus(i),a>t?(i[u]--,(e=s.plus(i))>t&&(a=e,i[u]--,e=s.plus(i))):e=a);return[e,i,a,o]}(e,t,r);const u=t-i,l=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===l.length&&(o0?Tr.fromMillis(u,n).shiftTo(...l).plus(c):c}function $r(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=r&&n<=i&&(t+=n-r)}}return parseInt(t,10)}return t}(e))}}const Dr=`[ ${String.fromCharCode(160)}]`,Vr=new RegExp(Dr,"g");function Mr(e){return e.replace(/\./g,"\\.?").replace(Vr,Dr)}function _r(e){return e.replace(/\./g,"").replace(Vr," ").toLowerCase()}function Lr(e,t){return null===e?null:{regex:RegExp(e.map(Mr).join("|")),deser:([r])=>e.findIndex(e=>_r(r)===_r(e))+t}}function Ur(e,t){return{regex:e,deser:([,e,t])=>it(e,t),groups:t}}function Fr(e){return{regex:e,deser:([e])=>e}}const qr={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Pr=null;function Ar(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const r=Wr(Tt.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t)))}class jr{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Ar(Tt.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const r=de(t),n=de(t,"{2}"),i=de(t,"{3}"),s=de(t,"{4}"),o=de(t,"{6}"),a=de(t,"{1,2}"),u=de(t,"{1,3}"),l=de(t,"{1,6}"),c=de(t,"{1,9}"),d=de(t,"{2,4}"),h=de(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return m(f);switch(f.val){case"G":return Lr(t.eras("short"),0);case"GG":return Lr(t.eras("long"),0);case"y":return $r(l);case"yy":case"kk":return $r(d,rt);case"yyyy":case"kkkk":return $r(s);case"yyyyy":return $r(h);case"yyyyyy":return $r(o);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return $r(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return $r(n);case"MMM":return Lr(t.months("short",!0),1);case"MMMM":return Lr(t.months("long",!0),1);case"LLL":return Lr(t.months("short",!1),1);case"LLLL":return Lr(t.months("long",!1),1);case"o":case"S":return $r(u);case"ooo":case"SSS":return $r(i);case"u":return Fr(c);case"uu":return Fr(a);case"uuu":case"E":case"c":return $r(r);case"a":return Lr(t.meridiems(),0);case"EEE":return Lr(t.weekdays("short",!1),1);case"EEEE":return Lr(t.weekdays("long",!1),1);case"ccc":return Lr(t.weekdays("short",!0),1);case"cccc":return Lr(t.weekdays("long",!0),1);case"Z":case"ZZ":return Ur(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return Ur(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return Fr(/[a-z_+-/]{1,256}?/i);case" ":return Fr(/[^\S\n\r]/);default:return m(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=[`^${(r=this.units).map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,r];this.regex=RegExp(e,"i"),this.handlers=t}var r}explainFromTokens(e){if(this.isValid){const[t,r]=function(e,t,r){const n=e.match(t);if(n){const e={};let t=1;for(const i in r)if(ze(r,i)){const s=r[i],o=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(n.slice(t,t+o))),t+=o}return[n,e]}return[n,{}]}(e,this.regex,this.handlers),[n,i,s]=r?function(e){let t,r=null;return Ue(e.z)||(r=j.create(e.z)),Ue(e.Z)||(r||(r=new ie(e.Z)),t=e.Z),Ue(e.q)||(e.M=3*(e.q-1)+1),Ue(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Ue(e.u)||(e.S=Ye(e.u)),[Object.keys(e).reduce((t,r)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return n&&(t[n]=e[r]),t},{}),r,t]}(r):[null,null,void 0];if(ze(r,"a")&&ze(r,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:i,specificOffset:s}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function zr(e,t,r){return new jr(e,r).explainFromTokens(t)}function Wr(e,t){if(!e)return null;const r=Tt.create(t,e).dtFormatter((Pr||(Pr=wn.fromMillis(1555555555555)),Pr)),n=r.formatToParts(),i=r.resolvedOptions();return n.map(t=>function(e,t,r){const{type:n,value:i}=e;if("literal"===n){const e=/^\s+$/.test(i);return{literal:!e,val:e?" ":i}}const s=t[n];let o=n;"hour"===n&&(o=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let a=qr[o];if("object"==typeof a&&(a=a[s]),a)return{literal:!1,val:a}}(t,e,i))}const Rr="Invalid DateTime",Zr=864e13;function Hr(e){return new ke("unsupported zone",`the zone "${e.name}" is not supported`)}function Br(e){return null===e.weekData&&(e.weekData=Ee(e.c)),e.weekData}function Yr(e){return null===e.localWeekData&&(e.localWeekData=Ee(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Gr(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new wn({...r,...t,old:r})}function Jr(e,t,r){let n=e-60*t*1e3;const i=r.offset(n);if(t===i)return[n,t];n-=60*(i-t)*1e3;const s=r.offset(n);return i===s?[n,i]:[e-60*Math.min(i,s)*1e3,Math.max(i,s)]}function Kr(e,t){const r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function Xr(e,t,r){return Jr(Qe(e),t,r)}function Qr(e,t){const r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),s={...e.c,year:n,month:i,day:Math.min(e.c.day,Xe(n,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},o=Tr.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=Qe(s);let[u,l]=Jr(a,r,e.zone);return 0!==o&&(u+=o,l=e.zone.offset(u)),{ts:u,o:l}}function en(e,t,r,n,i,s){const{setZone:o,zone:a}=r;if(e&&0!==Object.keys(e).length||t){const n=t||a,i=wn.fromObject(e,{...r,zone:n,specificOffset:s});return o?i:i.setZone(a)}return wn.invalid(new ke("unparsable",`the input "${i}" can't be parsed as ${n}`))}function tn(e,t,r=!0){return e.isValid?Tt.create(re.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function rn(e,t,r){const n=e.c.year>9999||e.c.year<0;let i="";if(n&&e.c.year>=0&&(i+="+"),i+=Ze(e.c.year,n?6:4),"year"===r)return i;if(t){if(i+="-",i+=Ze(e.c.month),"month"===r)return i;i+="-"}else if(i+=Ze(e.c.month),"month"===r)return i;return i+=Ze(e.c.day),i}function nn(e,t,r,n,i,s,o){let a=!r||0!==e.c.millisecond||0!==e.c.second,u="";switch(o){case"day":case"month":case"year":break;default:if(u+=Ze(e.c.hour),"hour"===o)break;if(t){if(u+=":",u+=Ze(e.c.minute),"minute"===o)break;a&&(u+=":",u+=Ze(e.c.second))}else{if(u+=Ze(e.c.minute),"minute"===o)break;a&&(u+=Ze(e.c.second))}if("second"===o)break;!a||n&&0===e.c.millisecond||(u+=".",u+=Ze(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&0===e.offset&&!s?u+="Z":e.o<0?(u+="-",u+=Ze(Math.trunc(-e.o/60)),u+=":",u+=Ze(Math.trunc(-e.o%60))):(u+="+",u+=Ze(Math.trunc(e.o/60)),u+=":",u+=Ze(Math.trunc(e.o%60)))),s&&(u+="["+e.zone.ianaName+"]"),u}const sn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},on={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},an={ordinal:1,hour:0,minute:0,second:0,millisecond:0},un=["year","month","day","hour","minute","second","millisecond"],ln=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],cn=["year","ordinal","hour","minute","second","millisecond"];function dn(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new a(e);return t}function hn(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return dn(e)}}function mn(e,t){const r=oe(t.zone,be.defaultZone);if(!r.isValid)return wn.invalid(Hr(r));const n=re.fromObject(t);let i,s;if(Ue(e.year))i=be.now();else{for(const t of un)Ue(e[t])&&(e[t]=sn[t]);const t=_e(e)||Le(e);if(t)return wn.invalid(t);const n=function(e){if(void 0===pn&&(pn=be.now()),"iana"!==e.type)return e.offset(pn);const t=e.name;let r=gn.get(t);return void 0===r&&(r=e.offset(pn),gn.set(t,r)),r}(r);[i,s]=Xr(e,n,r)}return new wn({ts:i,zone:r,loc:n,o:s})}function fn(e,t,r){const n=!!Ue(r.round)||r.round,i=Ue(r.rounding)?"trunc":r.rounding,s=(e,s)=>{e=Ge(e,n||r.calendary?0:2,r.calendary?"round":i);return t.loc.clone(r).relFormatter(r).format(e,s)},o=n=>r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(r.unit)return s(o(r.unit),r.unit);for(const e of r.units){const t=o(e);if(Math.abs(t)>=1)return s(t,e)}return s(e>t?-0:0,r.units[r.units.length-1])}function yn(e){let t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}let pn;const gn=new Map;class wn{constructor(e){const t=e.zone||be.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new ke("invalid input"):null)||(t.isValid?null:Hr(t));this.ts=Ue(e.ts)?be.now():e.ts;let n=null,i=null;if(!r){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,i]=[e.old.c,e.old.o];else{const s=Fe(e.o)&&!e.old?e.o:t.offset(this.ts);n=Kr(this.ts,s),r=Number.isNaN(n.year)?new ke("invalid input"):null,n=r?null:n,i=r?null:s}}this._zone=t,this.loc=e.loc||re.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=i,this.isLuxonDateTime=!0}static now(){return new wn({})}static local(){const[e,t]=yn(arguments),[r,n,i,s,o,a,u]=t;return mn({year:r,month:n,day:i,hour:s,minute:o,second:a,millisecond:u},e)}static utc(){const[e,t]=yn(arguments),[r,n,i,s,o,a,u]=t;return e.zone=ie.utcInstance,mn({year:r,month:n,day:i,hour:s,minute:o,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const r=(n=e,"[object Date]"===Object.prototype.toString.call(n)?e.valueOf():NaN);var n;if(Number.isNaN(r))return wn.invalid("invalid input");const i=oe(t.zone,be.defaultZone);return i.isValid?new wn({ts:r,zone:i,loc:re.fromObject(t)}):wn.invalid(Hr(i))}static fromMillis(e,t={}){if(Fe(e))return e<-Zr||e>Zr?wn.invalid("Timestamp out of range"):new wn({ts:e,zone:oe(t.zone,be.defaultZone),loc:re.fromObject(t)});throw new u(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Fe(e))return new wn({ts:1e3*e,zone:oe(t.zone,be.defaultZone),loc:re.fromObject(t)});throw new u("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=oe(t.zone,be.defaultZone);if(!r.isValid)return wn.invalid(Hr(r));const n=re.fromObject(t),i=ot(e,hn),{minDaysInFirstWeek:s,startOfWeek:a}=Me(i,n),u=be.now(),l=Ue(t.specificOffset)?r.offset(u):t.specificOffset,c=!Ue(i.ordinal),d=!Ue(i.year),h=!Ue(i.month)||!Ue(i.day),m=d||h,f=i.weekYear||i.weekNumber;if((m||c)&&f)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new o("Can't mix ordinal dates with month/day");const y=f||i.weekday&&!m;let p,g,w=Kr(u,l);y?(p=ln,g=on,w=Ee(w,s,a)):c?(p=cn,g=an,w=De(w)):(p=un,g=sn);let v=!1;for(const e of p){Ue(i[e])?i[e]=v?g[e]:w[e]:v=!0}const b=y?function(e,t=4,r=1){const n=qe(e.weekYear),i=Re(e.weekNumber,1,tt(e.weekYear,t,r)),s=Re(e.weekday,1,7);return n?i?!s&&Te("weekday",e.weekday):Te("week",e.weekNumber):Te("weekYear",e.weekYear)}(i,s,a):c?function(e){const t=qe(e.year),r=Re(e.ordinal,1,Ke(e.year));return t?!r&&Te("ordinal",e.ordinal):Te("year",e.year)}(i):_e(i),k=b||Le(i);if(k)return wn.invalid(k);const S=y?$e(i,s,a):c?Ve(i):i,[x,T]=Xr(S,l,r),O=new wn({ts:x,zone:r,o:T,loc:n});return i.weekday&&m&&e.weekday!==O.weekday?wn.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${O.toISO()}`):O.isValid?O:wn.invalid(O.invalid)}static fromISO(e,t={}){const[r,n]=function(e){return Nt(e,[er,ir],[tr,sr],[rr,or],[nr,ar])}(e);return en(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,n]=function(e){return Nt(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[Bt,Yt])}(e);return en(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,n]=function(e){return Nt(e,[Gt,Xt],[Jt,Xt],[Kt,Qt])}(e);return en(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(Ue(e)||Ue(t))throw new u("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:i=null}=r,s=re.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0}),[o,a,l,c]=function(e,t,r){const{result:n,zone:i,specificOffset:s,invalidReason:o}=zr(e,t,r);return[n,i,s,o]}(s,e,t);return c?wn.invalid(c):en(o,a,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return wn.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,n]=function(e){return Nt(e,[lr,ir],[cr,dr])}(e);return en(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new u("need to specify a reason the DateTime is invalid");const r=e instanceof ke?e:new ke(e,t);if(be.throwOnInvalid)throw new n(r);return new wn({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=Wr(e,re.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return Ar(Tt.parseFormat(e),re.fromObject(t)).map(e=>e.val).join("")}static resetCache(){pn=void 0,gn.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Br(this).weekYear:NaN}get weekNumber(){return this.isValid?Br(this).weekNumber:NaN}get weekday(){return this.isValid?Br(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Yr(this).weekday:NaN}get localWeekNumber(){return this.isValid?Yr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Yr(this).weekYear:NaN}get ordinal(){return this.isValid?De(this.c).ordinal:NaN}get monthShort(){return this.isValid?Cr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Cr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Cr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Cr.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=Qe(this.c),n=this.zone.offset(r-e),i=this.zone.offset(r+e),s=this.zone.offset(r-n*t),o=this.zone.offset(r-i*t);if(s===o)return[this];const a=r-s*t,u=r-o*t,l=Kr(a,s),c=Kr(u,o);return l.hour===c.hour&&l.minute===c.minute&&l.second===c.second&&l.millisecond===c.millisecond?[Gr(this,{ts:a}),Gr(this,{ts:u})]:[this]}get isInLeapYear(){return Je(this.year)}get daysInMonth(){return Xe(this.year,this.month)}get daysInYear(){return this.isValid?Ke(this.year):NaN}get weeksInWeekYear(){return this.isValid?tt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?tt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:n}=Tt.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(ie.instance(e),t)}toLocal(){return this.setZone(be.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=oe(e,be.defaultZone)).equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||r){const t=e.offset(this.ts),r=this.toObject();[n]=Xr(r,t,e)}return Gr(this,{ts:n,zone:e})}return wn.invalid(Hr(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){return Gr(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=ot(e,hn),{minDaysInFirstWeek:r,startOfWeek:n}=Me(t,this.loc),i=!Ue(t.weekYear)||!Ue(t.weekNumber)||!Ue(t.weekday),s=!Ue(t.ordinal),a=!Ue(t.year),u=!Ue(t.month)||!Ue(t.day),l=a||u,c=t.weekYear||t.weekNumber;if((l||s)&&c)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&s)throw new o("Can't mix ordinal dates with month/day");let d;i?d=$e({...Ee(this.c,r,n),...t},r,n):Ue(t.ordinal)?(d={...this.toObject(),...t},Ue(t.day)&&(d.day=Math.min(Xe(d.year,d.month),d.day))):d=Ve({...De(this.c),...t});const[h,m]=Xr(d,this.o,this.zone);return Gr(this,{ts:h,o:m})}plus(e){if(!this.isValid)return this;return Gr(this,Qr(this,Tr.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return Gr(this,Qr(this,Tr.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},n=Tr.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===n)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t=3&&(a+="T"),a+=nn(this,o,t,r,n,i,s),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?rn(this,"extended"===e,dn(t)):null}toISOWeekDate(){return tn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:i=!1,format:s="extended",precision:o="milliseconds"}={}){if(!this.isValid)return null;return o=dn(o),(n&&un.indexOf(o)>=3?"T":"")+nn(this,"extended"===s,t,e,r,i,o)}toRFC2822(){return tn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return tn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rn(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(t||e)&&(r&&(n+=" "),t?n+="z":e&&(n+="ZZ")),tn(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Rr}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return Tr.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=(a=t,Array.isArray(a)?a:[a]).map(Tr.normalizeUnit),s=e.valueOf()>this.valueOf(),o=Er(s?this:e,s?e:this,i,n);var a;return s?o.negate():o}diffNow(e="milliseconds",t={}){return this.diff(wn.now(),e,t)}until(e){return this.isValid?Ir.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const n=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,r)<=n&&n<=i.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||wn.fromObject({},{zone:this.zone}),r=e.padding?thise.valueOf(),Math.min)}static max(...e){if(!e.every(wn.isDateTime))throw new u("max requires all arguments be DateTimes");return je(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:n=null,numberingSystem:i=null}=r;return zr(re.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return wn.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:n=null}=t,i=re.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0});return new jr(i,e)}static fromFormatParser(e,t,r={}){if(Ue(e)||Ue(t))throw new u("fromFormatParser requires an input string and a format parser");const{locale:n=null,numberingSystem:i=null}=r,s=re.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0});if(!s.equals(t.locale))throw new u(`fromFormatParser called with a locale of ${s}, but the format parser was created for ${t.locale}`);const{result:o,zone:a,specificOffset:l,invalidReason:c}=t.explainFromTokens(e);return c?wn.invalid(c):en(o,a,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return m}static get DATE_MED(){return f}static get DATE_MED_WITH_WEEKDAY(){return y}static get DATE_FULL(){return p}static get DATE_HUGE(){return g}static get TIME_SIMPLE(){return w}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return b}static get TIME_WITH_LONG_OFFSET(){return k}static get TIME_24_SIMPLE(){return S}static get TIME_24_WITH_SECONDS(){return x}static get TIME_24_WITH_SHORT_OFFSET(){return T}static get TIME_24_WITH_LONG_OFFSET(){return O}static get DATETIME_SHORT(){return I}static get DATETIME_SHORT_WITH_SECONDS(){return C}static get DATETIME_MED(){return N}static get DATETIME_MED_WITH_SECONDS(){return E}static get DATETIME_MED_WITH_WEEKDAY(){return $}static get DATETIME_FULL(){return D}static get DATETIME_FULL_WITH_SECONDS(){return V}static get DATETIME_HUGE(){return M}static get DATETIME_HUGE_WITH_SECONDS(){return _}}function vn(e){if(wn.isDateTime(e))return e;if(e&&e.valueOf&&Fe(e.valueOf()))return wn.fromJSDate(e);if(e&&"object"==typeof e)return wn.fromObject(e);throw new u(`Unknown datetime argument: ${e}, of type ${typeof e}`)}t.DateTime=wn,t.Duration=Tr,t.FixedOffsetZone=ie,t.IANAZone=j,t.Info=Cr,t.Interval=Ir,t.InvalidZone=se,t.Settings=be,t.SystemZone=F,t.VERSION="3.7.1",t.Zone=L}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};r.r(n),r.d(n,{debug:()=>Ln,getCookie:()=>jn,init:()=>Un,integration:()=>Pn,overlay:()=>An,personalize:()=>Fn,track:()=>qn});const i="do-not-track",s="data-var-name",o="sailthru_sess_overlay_params",a="sailthru_session_overlay",u="sailthru_dismiss_overlay",l="STdebug",c="STpreview",d="STpageviewsOverride";function h(e,t){const r=encodeURIComponent(t)+"=";for(const t of(document.cookie||"").split(/;\s*/))t.startsWith(r)&&e.push(decodeURIComponent(t.substring(r.length)))}const m={getCookie(e){const t=String(e),r=function(e){const t=[];return h(t,e),t}(t);if("sailthru_hid"===t)for(const e of r)if(e===i||"optout"===e)return e;const n=r.length&&r[0]||"";return"string"==typeof n?n.trim():""}};function f(e){return/^(?:\d{1,3}\.){3}\d{1,3}$/.test(e)}function y(e,t,{value:r="",minutes:n,domain:i,secureFlag:s,isDeletion:o=!1}={}){const a=[`${encodeURIComponent(e)}=${encodeURIComponent(r)}`,"Path=/",`SameSite=${t}`];if(o)a.push("Max-Age=0","Expires=Thu, 01 Jan 1970 00:00:00 GMT");else if("number"==typeof n){const e=Math.floor(60*n*1e3),t=new Date(Date.now()+Math.max(e,0)).toUTCString();a.push(`Expires=${t}`),a.push(`Max-Age=${Math.max(0,Math.floor(e/1e3))}`)}return i&&a.push(`Domain=${i}`),("none"===t.toLowerCase()||s)&&a.push("Secure"),a}function p(e,t,r,n){return y(e,r,{value:t,...n}).join("; ")}function g(e,t,r){return y(e,t,{...r,isDeletion:!0}).join("; ")}function w(e,t=null,n=null,{secure:i,sameSite:s="Lax",minutes:o}={}){if(!e)return{success:!0,cookieWasSet:!1,shouldCache:!0};if(!(null!=t&&`${t}`.length>0)||!(null!=n))return{success:!1,cookieWasSet:!1,shouldCache:!1};const a=i||"none"===s.toLowerCase(),u=`${n}__sentinel_${function(e=4){const t=void 0!==r.g&&r.g.crypto?r.g.crypto:void 0,n=globalThis.crypto||t;return n?.getRandomValues?[...n.getRandomValues(new Uint8Array(e))].map(e=>Number(e).toString(16).padStart(2,"0")).join(""):Array.from({length:e},()=>Math.floor(256*Math.random()).toString(16).padStart(2,"0")).join("")}(4)}`,l=p(t,u,s,{minutes:1/60,domain:e,secureFlag:a});document.cookie=l;const c=`${encodeURIComponent(t)}=${encodeURIComponent(u)}`;if(!document.cookie.split(/;\s*/).some(e=>e===c))return{success:!1,cookieWasSet:!1,shouldCache:!1};const d=p(t,n,s,{minutes:o,domain:e,secureFlag:a});return document.cookie=d,{success:!0,cookieWasSet:!0,shouldCache:!0}}function v(e){return null==e?e:`${e}`.replace(/^\.+/,"").toLowerCase()}function b(e){const t=`${e}=`,r=encodeURIComponent(`${e}`)+"=";return!(document.cookie||"").split(/;\s*/).some(e=>e.startsWith(t)||e.startsWith(r))}const k={create(e,t,n,i,s={}){const{sameSite:o="Lax",secure:a="https:"===location.protocol}=s;let u=null,l=!1;if(null!=i){const s=function({preferred:e,sameSite:t="Lax",secure:n,cookieName:i=null,cookieValue:s=null,minutes:o}={}){const a="undefined"!=typeof globalThis&&globalThis.location||"undefined"!=typeof window&&window.location||void 0!==r.g&&r.g.location||{hostname:"",protocol:""};let u=a.hostname||"";if("boolean"!=typeof n&&(n="https"===(a.protocol||"").replace(/:$/,"")),!u&&e&&(u=e),!u||"localhost"===u||f(u))return null;const l=e?v(e):null,c=`cookie-domain:${u}:${t}:${n?1:0}`,d={get(){try{const e=sessionStorage.getItem(c);return null===e?null:""===e?"":v(e)}catch{return null}},set(e){try{sessionStorage.setItem(c,e??"")}catch{}}},h=d.get();if(null!==h)return{domain:""===h?null:h,cookieWasSet:!1};if(l){const e=w(l,i,s,{sameSite:t,secure:n,minutes:o});if(e.success)return e.shouldCache&&d.set(l),{domain:l,cookieWasSet:e.cookieWasSet}}const m=v(u),y=w(m,i,s,{sameSite:t,secure:n,minutes:o});return y.success?(y.shouldCache&&d.set(m),{domain:m,cookieWasSet:y.cookieWasSet}):(d.set(""),{domain:null,cookieWasSet:!1})}({preferred:i,sameSite:o,secure:a,cookieName:e,cookieValue:t,minutes:n});u=s.domain,l=s.cookieWasSet}if(!l){const r=p(e,t,o,{minutes:n,domain:u,secureFlag:"none"===o.toLowerCase()||!0===s.secure||a});document.cookie=r}return document.cookie.includes(`${encodeURIComponent(e)}=`)},read:m.getCookie,delete(e,t=void 0,r={}){const{sameSite:n="Lax",secure:i="https:"===location.protocol}=r;for(const r of function(e){const t=v(location.hostname),r=new Set,n=[];if(e&&"localhost"!==e&&!f(e)){const t=v(e);t&&!r.has(t)&&(r.add(t),n.push(t))}const i=t.split(".");for(let e=1;e-1===e.indexOf(i)).join("")}r=`00${o}${r}`,r=r.slice(0,1682),this.create("sailthru_pc",r,525600)},updateSailthruContentCookie(e){if(this.handleGDPR())return;let t=this.read("sailthru_content");if(e){const r=e.length,n=16*r,i=t.indexOf(e);-1!==i&&(t=t.substring(0,i)+t.substring(i+r));let s=t+e;s=s.length>n?s.substring(r):s,this.delete("sailthru_content"),this.create("sailthru_content",s,525600)}},updatePageviewsCookie(){if(this.handleGDPR()){const e=this.getSessionCookieName("sailthru_pageviews");let t=this.readCookieValue("sailthru_pageviews");t=Number(t)+1,this.create(e,t)}else{const e=this.read("sailthru_overlays");let t=this.read("sailthru_pageviews");t=Number(t)+1,this.create("sailthru_pageviews",t,30),e.length>0&&this.create("sailthru_overlays",e,30)}},setSailthruHid(e){if(!e)return void this.delete("sailthru_hid");const t=this.getCookieDomain(window.location.hostname);this.create("sailthru_hid",e,525600,t)},setCookiesDoNotTrack(){return this.create("sailthru_no_cookies","1",525600)},unsetCookiesDoNotTrack(){this.delete("sailthru_no_cookies"),this.read("sailthru_hid")===i&&this.setSailthruHid(null),this.convertSessionCookiesToPersistent()},convertSessionCookiesToPersistent(){const e=this.getSessionCookieName("sailthru_pageviews"),t=this.read(e);t&&(this.delete(e),this.create("sailthru_pageviews",t,30));const r=this.getSessionCookieName("sailthru_overlays"),n=this.read(r);n&&(this.delete(r),this.create("sailthru_overlays",n,30))},isAnonymousUser(){return!this.read("sailthru_hid")},isDoNotTrackUser(){const e=this.read("sailthru_hid"),t=this.read("sailthru_no_cookies");return e===i||"optout"===e||!!t},refreshNoCookies(){this.read("sailthru_no_cookies")&&this.setCookiesDoNotTrack()},handleGDPR(){return!!this.isDoNotTrackUser()&&(this.delete("sailthru_content"),this.delete("sailthru_pc"),this.delete("sailthru_bid"),this.delete("sailthru_sid"),this.delete("sailthru_cid"),this.delete("sailthru_rid"),this.delete("sailthru_recommendation_hidden"),this.delete("sailthru_visitor"),this.delete("sailthru_overlays"),this.convertToSessionCookie("sailthru_pageviews",1),this.delete("sailthru_hid"),this.setSailthruHid(i),!0)},getCookieDomain(e){const t=/(?:[\w-]+\.(?:com|co|gov|edu|org|net)\.[\w-]{1,2}|[\w-]+\.[\w-]{2,})$/.exec(e);return t?t[0]:null},getPageViewsCount(){let e=this.readCookieValue("sailthru_pageviews")||0;return Number(e)},readCookieValue(e){const t=this.getSessionCookieName(e);return this.read(t)||this.read(e)},convertToSessionCookie(e,t=1){const r=this.getSessionCookieName(e);this.read(e)&&!this.read(r)&&this.create(r,t),this.delete(e)},getSessionCookieName:e=>`${e}_session`},S={defaultPageviewOnError:e=>`Pageview was not tracked: ${e.responseText&&JSON.parse(e.responseText).error||e.error||"Check url and configuration."}`,getData(e,t,r){const n={...t,url:e,pageview:!0,visitorId:k.read("sailthru_visitor"),apiUrl:`${r.trackDomain}/v1/track/event/pageview`},i=document.querySelectorAll&&document.querySelectorAll('meta[name="sailthru.tags"]').length>0&&document.querySelectorAll('meta[name="sailthru.tags"]')[0].getAttribute("content"),s=document.querySelectorAll&&document.querySelectorAll('meta[name="keywords"]').length>0&&document.querySelectorAll('meta[name="keywords"]')[0].getAttribute("content"),o=i||s||"";return n.visitorId=k.read("sailthru_visitor"),n.messageId=k.read("sailthru_bid"),n.excludeContent=r.excludeContent,"true"===n.excludeContent?n.excludeContent=!0:"boolean"!=typeof n.excludeContent&&(n.excludeContent=!1),void 0===n.useStoredTags&&(n.useStoredTags=r.useStoredTags),"false"===n.useStoredTags?n.useStoredTags=!1:"boolean"!=typeof n.useStoredTags&&(n.useStoredTags=!0),n.tags=void 0!==n.tags?n.tags.toString():o,n}},x=(e,t,r)=>{if("undefined"==typeof AbortController||!r)return fetch(e,t);const n=new AbortController,i={...t,signal:n.signal};return new Promise((t,s)=>{let o=setTimeout(()=>{n.abort(),s(new Error("Request timed out"))},r);fetch(e,i).then(e=>{clearTimeout(o),t(e)},e=>{clearTimeout(o),s(e)})})},T=e=>{function t(e){const t=window.document.createElement("div");return t.innerHTML=``,t.firstChild.href}function r(t){let r={...t};if(delete r.apiUrl,r.onSuccess&&delete r.onSuccess,r.onError&&delete r.onError,r.elementId&&delete r.elementId,r.pageview&&delete r.pageview,void 0===t.userIdKey||""===t.userIdKey||"HID"===t.userIdKey.toUpperCase()){const e=k.read("sailthru_hid");void 0!==e&&""!==e&&(r.userIdKey="hid",r.userIdValue=e)}return r=JSON.stringify(r),x(t.apiUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":e.VERSION,Authorization:`Bearer ${e.customerId}`},body:r},2e3).then(e=>e.json()).then(e=>{if(e&&(e.error||e.message))throw e;t&&(t.elementId&&(e.elementId=t.elementId),e.doNotTrack&&(k.setSailthruHid(i),k.handleGDPR()),t.pageview&&k.updateSailthruContentCookie(e.contentHash),t.onSuccess&&t.onSuccess(e),t.visitorId||!e.visitorId||k.handleGDPR()||k.create("sailthru_visitor",e.visitorId,525600))}).catch(e=>{let r;e&&e.responseText&&(r=JSON.parse(e.responseText),console.log(`You have the following track error: ${r.message}`)),t&&(t.elementId&&(e.elementId=t.elementId),t.pageview&&console.error(S.defaultPageviewOnError(e)),t.onError&&t.onError(e))})}return{click(n,i,s){const o={...s,sectionId:n,url:t(i),apiUrl:`${e.trackDomain}/v1/track/event/click/`};return n&&i?r(o):(console.log("url, and sectionId are required for trackClick.",o),!1)},impression(n,i,s){Array.isArray(i)?i=i.map(t):"object"==typeof i&&Object.keys(i).length>0&&(s=i,i=void 0);const o={...s,sectionId:n,apiUrl:`${e.trackDomain}/v1/track/event/impression/`};return n?(i&&i.length>0&&(o.urls=i),r(o)):(console.log("sectionId are required for trackImpression.",o),!1)},pageview(n,i){if(n){const s=t(n);return r(S.getData(s,i,e))}return console.log("url is required for trackPageView.",n,i),!1},navigation(n,i){if(n){return r({...i,url:t(n),index:Date.now(),type:"navigation",visitorId:k.read("sailthru_visitor"),apiUrl:`${e.trackDomain}/v1/track/heartbeat`})}return console.log("url is required for heartbeat navigation",n,i),!1},heartbeat(n,i){if(n){return r({...i,url:t(n),index:Date.now(),type:"heartbeat",visitorId:k.read("sailthru_visitor"),apiUrl:`${e.trackDomain}/v1/track/heartbeat`})}return console.log("url is required for heartbeat",n,i),!1},gdprDoNotTrack(t){const r=k.read("sailthru_hid");if(!r)return k.setSailthruHid(i),void k.handleGDPR();k.setSailthruHid(i),k.handleGDPR(),fetch(`${e.trackDomain}/v1/profile/${r}`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":e.VERSION,Authorization:`Bearer ${e.customerId}`},body:JSON.stringify({doNotTrack:!0})}).then(e=>e.json()).then(e=>{if(e&&(e.error||e.message))throw e;t&&t.onSuccess&&t.onSuccess(e)}).catch(e=>{t&&t.onError&&t.onError(e)})},cookiesDoNotTrack(e){!e||!1!==e.set?(k.setCookiesDoNotTrack(),k.handleGDPR()):k.unsetCookiesDoNotTrack()}}};let O,I={},C=!0;function N(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function E(e,t){if(void 0===e.userIdKey||"hid"===e.userIdKey){const e=k.read("sailthru_hid");e&&(t.push("userIdKey=hid"),t.push(`userIdValue=${e}`))}else e.userIdValue&&(t.push(`userIdKey=${e.userIdKey}`),t.push(`userIdValue=${e.userIdValue}`));return t}function $(){const e=window.location.hash.substr(1);return O=e.split("&").map(e=>e.split("=")).reduce((e,t)=>(e[t[0]]=decodeURIComponent(t[1]),e),{}),O}function D(){return void 0!==O[c]}function V(){if(D())return O[c]}function M(e,t){if(void 0!==e){const r=e?"1":"0";t.push(`isMobile=${r}`)}return t}function _(e){const t=function(){const e=k.read(o);return e?decodeURIComponent(e):window.location.search}();if(t&&t.length>1&&"?"===t[0])if("function"==typeof URL){const r=new URL(`http://domain.tld${t}`).searchParams;for(const t of r.keys())e.push(`page=${encodeURIComponent(`${t}=${r.get(t)}`)}`)}else{const r=function(e){const t=/([^=?&]+)=?([^&]*)/g,r={};let n,i,s;for(;n=t.exec(e);)i=N(n[1]),s=N(n[2]),null===i||null===s||i in r||(r[i]=s);return r}(t);for(const t of Object.keys(r))e.push(`page=${encodeURIComponent(`${t}=${r[t]}`)}`)}return e}function L(){let e;const t=window.location.search,r=/[?&]+([^=&]+)=([^&]*)[^&#]*/gi;for(;e=r.exec(t);)I[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return C=!1,I}function U(e){C&&L();return I[e]}function F(){C=!0,I={}}const q=()=>($(),L(),{pushUserIdKeyAndUserIdValue:E,urlHashToMap:$,getPreviewIdFromAnchor:V,isPreview:D,urlFragmentParams:O,pushDeviceTypeInfo:M,getUrlParam:U,pushLandingPageParams:_,reset:F});let P,A,j,z,W,R,Z,H=!1;function B(){return H=!0,window.clearInterval(z),window.clearInterval(W),console.log("Heartbeat stopped"),{lostVisibility:H,firstHeartbeatInterval:z,secondHeartbeatInterval:W}}function Y(e,t,r){const n=window.setInterval(()=>{(new Date).getTime()-e>r?window.clearInterval(n):A.heartbeat(window.location.href,{onError:B})},t);return n}function G(){H&&(H=!1,A.navigation(window.location.href,{onError:B}));const e=(new Date).getTime();return z=Y(e,1e4,3e4),W=Y(e,6e4,174e4),{lostVisibility:H,firstHeartbeatInterval:z,secondHeartbeatInterval:W}}function J(){return document[R]?B():G()}function K(){return void 0!==document.hidden?(R="hidden",Z="visibilitychange"):void 0!==document.msHidden?(R="msHidden",Z="msvisibilitychange"):void 0!==document.webkitHidden&&(R="webkitHidden",Z="webkitvisibilitychange"),void 0===document.addEventListener||void 0===document.hidden?(console.log("Heartbeat requires a browser that supports the Page Visibility API"),!1):k.isAnonymousUser()?(j.urlFragmentParams[l]&&console.log("Heartbeat only works for known users"),!1):P.enableHeartbeat?(document.addEventListener(Z,J,!1),G()):(j.urlFragmentParams[l]&&console.log("Heartbeat disabled"),!1)}const X=e=>(P=e,A=T(e),H=!1,j=q(),{appendHearbeatListener:K}),Q=e=>{function t(e){const t={...e};return void 0!==t.source&&(t.vars=t.vars||{},t.vars.source=t.source,delete t.source),t}function r(t,r){const n={...t};delete n.apiUrl;const i={method:r||"POST",credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":e.VERSION,Authorization:`Bearer ${e.customerId}`}};return"POST"===i.method&&(i.body=JSON.stringify(n)),fetch(t.apiUrl,i).then(e=>e.json()).then(e=>{if(e&&(e.message||e.error||e.errors))throw e;"function"==typeof t.onSuccess&&t.onSuccess(e)}).catch(e=>{"function"==typeof t.onError?t.onError(e):e&&(e.error||e.message||e.errors)&&console.error(`You have the following error: ${e.error||e.message||e.errors}`)})}function n(e){return"object"==typeof e&&"string"==typeof e.key&&("string"==typeof e.id||"number"==typeof e.id)}function i(e){let t;return"string"==typeof e?{id:e,key:"email"}:"object"==typeof e&&n(e)?e:(t=k.read("sailthru_hid"))?{id:t,key:"cookie"}:{id:void 0,key:void 0}}return{getCurrentUser(n){const i=`${e.trackDomain}/v1/track/user?`,s=k.read("sailthru_hid");if(s){const e=[];e.push("user_id_key=hid"),n.hash&&e.push(`hash=${n.hash}`),e.push(`user_id_value=${s}`);const o=i+e.join("&");return r(t({...n,apiUrl:o}),"GET")}return console.error("Please make sure the sailthru_hid cookie is set."),!1},userSignUp(n,s){const o=`${e.trackDomain}/v1/track/user/signup`;n=i(n);const a=void 0!==s.lists&&s.lists||void 0!==s.vars&&s.vars||void 0!==s.source&&s.source;const u=t({...n,...s,apiUrl:o,onSuccess:function(e){if(e?.sailthruHid&&k.setSailthruHid(e.sailthruHid),"function"==typeof s.onSuccess)return s.onSuccess(this,e)}});return k.read("sailthru_hid")||(u.content=k.read("sailthru_content")),("sms"===u.key||"email"===u.key)&&u.id&&a?r(u):(console.error("Please make sure to include a valid id/key plus a lists or a vars option.",u),!1)},userSignUpConfirmedOptIn(i,s){const o=`${e.trackDomain}/v1/track/user/signup`;if(!(void 0!==s&&void 0!==s.template&&void 0!==s.template.name)||!n(i))return console.error("Please make sure that the integration options include a template and id/key pair: ",s),!1;const a=t({...s,id:i.id,key:i.key||"email",apiUrl:o});return k.read("sailthru_hid")||(a.content=k.read("sailthru_content")),r(a)},addToCart(t,n){const s=`${e.trackDomain}/v1/track/addToCart`,o=n&&n.items&&n.items.filter(e=>void 0!==e.sku||void 0!==e.url).length>0,a=n&&n.items&&0===n.items.length,u={...i(t),...n,apiUrl:s};return u.id&&(o||a)?r(u):(console.error("Please make sure to include an id and key plus an items sku or items url option.",u),!1)},purchase(t,n){const s=`${e.trackDomain}/v1/track/purchase`,o=n&&n.items&&n.items.filter(e=>void 0!==e.sku||void 0!==e.url).length>0,a=n&&n.incomplete&&n.items&&0===n.items.length,u=k.read("sailthru_bid"),l=k.read("sailthru_pc");t=i(t);const c={...t,...n,apiUrl:s};return u&&(c.message_id=u),l&&(c.cookies={sailthru_pc:l}),c.id&&(o||a)?r(c):(console.error("Please make sure to include an id and key plus an items sku or items url option.",c),!1)},watchContent(t,n={}){const s=`${e.trackDomain}/v1/track/content/watch`,{id:o,key:a}=i(t),u={apiUrl:s,profile_id:o,profile_id_type:a,watch:n},{query:l={}}=u.watch;return Object.keys(l).length&&u.watch.interest_type?r(u):(console.error("Please make sure to include a query and interest type.",u),!1)},customEvent(t,n,s){const o=`${e.trackDomain}/v1/track/event/custom`,a="string"==typeof t;n=i(n);const u={...n,...s,apiUrl:o,event:t||void 0,vars:s.vars||void 0};return u.id&&a?r(u):(console.error("Please make sure to include a custom event name and id.",u),!1)}}};function ee(e){return Array.from(document.getElementsByName(e)).find(e=>e.checked)?.value??null}function te(e){if("checkbox"===e.type&&e.name){const t=e.form||document,r=Array.from(t.querySelectorAll(`input[type="checkbox"][name="${CSS.escape(e.name)}"]`));if(r.length>1&&r.some(e=>e.required)){const e=r.some(e=>e.checked&&!e.disabled),t=r.find(e=>e.required)||r[0];return t.setCustomValidity(e?"":"Please select at least one option."),t.reportValidity?.(),e}}return!("function"==typeof e.checkValidity&&!e.checkValidity())||(e.reportValidity?.(),!1)}const re=/^lists\[(.+?)\]/;function ne(e){return e.getAttribute?.(s)??e.name??e.id??""}function ie(e,t,r,n){e.errors.push({code:t,name:r,message:n})}function se(e,t,r){try{return!!te(e)||(ie(r,"required",t,"This field is required."),!1)}catch(e){return ie(r,"validation_exception",t,e?.message??"Validation threw an exception."),ie(r,"required",t,"This field is required."),!1}}function oe(e){if("checkbox"!==e.type)return null;const t=e.name??e.getAttribute?.("name")??"",r=re.exec(t);return r?r[1]:null}function ae(e,t,r){e.lists[t]=r.checked?1:0}function ue(e){return e.getAttribute?.(s)??""}function le(e,t){if(!t)return null;if("FORM"===e.nodeName)return ee(t);const r=e.getAttribute?.("data-var-attribute");return r?e[r]:null}function ce(e,t,r,n){const i=t.getAttribute?.("data-var-type");if("bee_radio_checkbox"===i)if(t.checked){const t=e.vars[r];e.vars[r]=t?`${t},${n}`:n}else e.vars[r]??="";else e.vars[r]=n}function de(e){console.log("getVars() non-blocking error:",e)}const he={getVars:function(){const e=document.querySelectorAll(".sailthru-var"),t={vars:Object.create(null),lists:Object.create(null),errors:[]};for(const r of e){if(!se(r,ne(r),t))continue;const e=oe(r);if(e){ae(t,e,r);continue}const n=ue(r),i=le(r,n);if(n&&null!=i&&""!==String(i).trim())try{ce(t,r,n,i)}catch(e){de(e)}}return t},getCheckedValue:ee,validateRequiredElement:te},me={parseUuidsList(e){if(null==e||""==e)return[];if(e.length>36&&","===e.charAt(36))return e.split(",");let t=[];for(let r=0;r<=e.length-36;r+=36)t.push(e.substring(r,r+36));return t},isUuid:e=>!!e.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)};let fe;function ye(e,t){const r={apiUrl:`${fe.overlayTrackDomain}/v1/overlay/${e}`,overlay_id:t.overlay_id,target_audience:t.target_audience,visitor_id:k.read("sailthru_visitor"),sticky:!!me.parseUuidsList(k.read(a))[0]};"lists"===t.target_audience&&(r.lists=t.lists),t.experiment_id&&(r.experiment_id=t.experiment_id,r.variant_id=t.variant_id);const n=k.read("sailthru_hid");return void 0!==n&&n.length>0&&(r.user_id_key="hid",r.user_id_value=n),r}function pe(e){let t={...e};return delete t.apiUrl,t.onSuccess&&delete t.onSuccess,t.onError&&delete t.onError,t=JSON.stringify(t),fetch(e.apiUrl,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json","X-Lib-Version":fe.VERSION,Authorization:`Bearer ${fe.customerId}`},body:t}).then(e=>e.json()).then(t=>{if(t&&(t.error||t.message))throw t;e.onSuccess&&e.onSuccess(t)}).catch(t=>{let r;t&&t.responseText&&(r=JSON.parse(t.responseText),console.error(`You have the following overlay track error: ${r.message}`)),e.onError&&e.onError(t)})}const ge=e=>(fe=e,{view:e=>pe(ye("view",e)),conversion:(e,t)=>pe({...ye("conversion",e),...t}),click:e=>pe(ye("click",e))});let we,ve;function be(e){we=e,k.create(a,e)}function ke(){const e=ve.getUrlParam("SToverlay");if(""===e)return void console.error("Empty overlay id. Please specify a valid uuid.");const t=me.parseUuidsList(k.read(a))[0];if(e&&!me.isUuid(e)&&!t)return void console.error(`Invalid id: ${e}. Please specify a valid uuid.`);if(e)return function(e){const t=k.read(u),r=me.parseUuidsList(t);t&&-1!==r.indexOf(e)&&(t===e?k.delete(u):k.create(u,t.replace(e,"")))}(e),k.create(o,window.location.search),be(e),e;const r=me.parseUuidsList(k.read(u));return t&&-1===r.indexOf(t)?(be(t),t):void 0}function Se(){return we}function xe(e){"string"==typeof e&&me.isUuid(e)?(k.delete(o),k.delete(a),function(e){const t=k.read(u);-1===me.parseUuidsList(t).indexOf(e)&&(t?k.create(u,`${e}${t}`):k.create(u,e))}(e)):console.error(`Invalid id: ${e}. Please specify a valid uuid.`)}const Te=()=>(ve=q(),{triggerStickyOverlay:ke,getStickyOverlayId:Se,dismiss:xe});let Oe,Ie;const Ce=[];function Ne(){clearTimeout(Oe),Ce.forEach(function(e){document.removeEventListener(e.event,e.handler)})}function Ee(e,t){Oe=setTimeout(()=>{Ie(e),Ne()},t)}function $e(e,t,r){const n=t.timer.event_handler[e];if("page_interaction"===e){let e;"reset"===n&&(e=function(){!function(e,t){clearTimeout(Oe),Ee(e,t)}(t,r)}),"cancel"===n&&(e=function(){Ne()}),e&&(["mousemove","mousedown","click","scroll","keydown"].forEach(function(t){Ce.push({event:t,handler:e}),document.addEventListener(t,e)}),Ee(t,r))}}function De(e){if("page"===e.timer.scope){const t=e.timer.threshold_ms||0;if(e.timer.event_handler){const r=Object.keys(e.timer.event_handler);for(const n of r)$e(n,e,t)}else setTimeout(()=>{Ie(e)},t)}else Ie(e)}const Ve=e=>(Ie=e,{renderTimeDelayedOverlay:De});var Me,_e="user-agent",Le="",Ue="function",Fe="undefined",qe="object",Pe="string",Ae="browser",je="cpu",ze="device",We="engine",Re="os",Ze="result",He="name",Be="type",Ye="vendor",Ge="version",Je="architecture",Ke="major",Xe="model",Qe="console",et="mobile",tt="tablet",rt="smarttv",nt="wearable",it="xr",st="embedded",ot="inapp",at="brands",ut="formFactors",lt="fullVersionList",ct="platform",dt="platformVersion",ht="bitness",mt="sec-ch-ua",ft=mt+"-full-version-list",yt=mt+"-arch",pt=mt+"-"+ht,gt=mt+"-form-factors",wt=mt+"-"+et,vt=mt+"-"+Xe,bt=mt+"-"+ct,kt=bt+"-version",St=[at,lt,et,Xe,ct,dt,Je,ut,ht],xt="Amazon",Tt="Apple",Ot="ASUS",It="BlackBerry",Ct="Google",Nt="Huawei",Et="Lenovo",$t="Honor",Dt="LG",Vt="Microsoft",Mt="Motorola",_t="Nvidia",Lt="OnePlus",Ut="OPPO",Ft="Samsung",qt="Sharp",Pt="Sony",At="Xiaomi",jt="Zebra",zt="Chrome",Wt="Chromium",Rt="Chromecast",Zt="Edge",Ht="Firefox",Bt="Opera",Yt="Facebook",Gt="Sogou",Jt="Mobile ",Kt=" Browser",Xt="Windows",Qt=typeof window!==Fe&&window.navigator?window.navigator:void 0,er=Qt&&Qt.userAgentData?Qt.userAgentData:void 0,tr=function(e){for(var t={},r=0;r0){for(var r in e)if(or(t)==or(e[r]))return!0;return!1}return!!ir(e)&&or(t)==or(e)},nr=function(e,t){for(var r in e)return/^(browser|cpu|device|engine|os)$/.test(r)||!!t&&nr(e[r])},ir=function(e){return typeof e===Pe},sr=function(e){if(e){for(var t=[],r=lr(/\\?\"/g,e).split(","),n=0;n-1){var i=dr(r[n]).split(";v=");t[n]={brand:i[0],version:i[1]}}else t[n]=dr(r[n]);return t}},or=function(e){return ir(e)?e.toLowerCase():e},ar=function(e){return ir(e)?lr(/[^\d\.]/g,e).split(".")[0]:void 0},ur=function(e){for(var t in e){var r=e[t];typeof r==qe&&2==r.length?this[r[0]]=r[1]:this[r]=void 0}return this},lr=function(e,t){return ir(t)?t.replace(e,Le):t},cr=function(e){return lr(/\\?\"/g,e)},dr=function(e,t){if(ir(e))return e=lr(/^\s\s*/,e),typeof t===Fe?e:e.substring(0,500)},hr=function(e,t){if(e&&t)for(var r,n,i,s,o,a,u=0;u0?2===s.length?typeof s[1]==Ue?this[s[0]]=s[1].call(this,a):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]!==Ue||s[1].exec&&s[1].test?3==s.length?this[s[0]]=a?a.replace(s[1],s[2]):void 0:4==s.length?this[s[0]]=a?s[3].call(this,a.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=a?s[3].apply(this,[a.replace(s[1],s[2])].concat(s.slice(4))):void 0):s.length>3?this[s[0]]=a?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=a?s[1].call(this,a,s[2]):void 0):this[s]=a||void 0;u+=2}},mr=function(e,t){for(var r in t)if(typeof t[r]===qe&&t[r].length>0){for(var n=0;n2&&this.set(Xe,"iPad").set(Be,tt);break;case Re:!this.get(He)&&er&&er[ct]&&this.set(He,er[ct]);break;case Ze:var e=this.data,t=function(t){return e[t].getItem().detectFeature().get()};this.set(Ae,t(Ae)).set(je,t(je)).set(ze,t(ze)).set(We,t(We)).set(Re,t(Re))}return this},this.parseUA=function(){return this.itemType!=Ze&&hr.call(this.data,this.ua,this.rgxMap),this.itemType==Ae&&this.set(Ke,ar(this.get(Ge))),this},this.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case Ae:case We:var r,n=e[lt]||e[at];if(n)for(var i in n){var s=n[i].brand||n[i],o=n[i].version;this.itemType==Ae&&!/not.a.brand/i.test(s)&&(!r||/Chrom/.test(r)&&s!=Wt||r==Zt&&/WebView2/.test(s))&&(s=mr(s,pr),(r=this.get(He))&&!/Chrom/.test(r)&&/Chrom/.test(s)||this.set(He,s).set(Ge,o).set(Ke,ar(o)),r=s),this.itemType==We&&s==Wt&&this.set(Ge,o)}break;case je:var a=e[Je];a&&(a&&"64"==e[ht]&&(a+="64"),hr.call(this.data,a+";",t));break;case ze:if(e[et]&&this.set(Be,et),e[Xe]&&(this.set(Xe,e[Xe]),!this.get(Be)||!this.get(Ye))){var u={};hr.call(u,"droid 9; "+e[Xe]+")",t),!this.get(Be)&&u.type&&this.set(Be,u.type),!this.get(Ye)&&u.vendor&&this.set(Ye,u.vendor)}if(e[ut]){var l;if("string"!=typeof e[ut])for(var c=0;!l&&c=13?"11":"10"),this.set(He,d).set(Ge,h)}this.get(He)==Xt&&"Xbox"==e[Xe]&&this.set(He,"Xbox").set(Ge,void 0);break;case Ze:var m=this.data,f=function(t){return m[t].getItem().setCH(e).parseCH().get()};this.set(Ae,f(Ae)).set(je,f(je)).set(ze,f(ze)).set(We,f(We)).set(Re,f(Re))}return this},ur.call(this,[["itemType",e],["ua",t],["uaCH",n],["rgxMap",r],["data",vr(this,e)]]),this}function Sr(e,t,r){if(typeof e===qe?(nr(e,!0)?(typeof t===qe&&(r=t),t=e):(r=e,t=void 0),e=void 0):typeof e!==Pe||nr(t,!0)||(r=t,t=void 0),r&&typeof r.append===Ue){var n={};r.forEach(function(e,t){n[t]=e}),r=n}if(!(this instanceof Sr))return new Sr(e,t,r).getResult();var i=typeof e===Pe?e:r&&r[_e]?r[_e]:Qt&&Qt.userAgent?Qt.userAgent:Le,s=new br(r,!0),o=t?function(e,t){var r={},n=t;if(!nr(t))for(var i in n={},t)for(var s in t[i])n[s]=t[i][s].concat(n[s]?n[s]:[]);for(var o in e)r[o]=n[o]&&n[o].length%2==0?n[o].concat(e[o]):e[o];return r}(gr,t):gr,a=function(e){return e==Ze?function(){return new kr(e,i,o,s).set("ua",i).set(Ae,this.getBrowser()).set(je,this.getCPU()).set(ze,this.getDevice()).set(We,this.getEngine()).set(Re,this.getOS()).get()}:function(){return new kr(e,i,o[e],s).parseUA().get()}};return ur.call(this,[["getBrowser",a(Ae)],["getCPU",a(je)],["getDevice",a(ze)],["getEngine",a(We)],["getOS",a(Re)],["getResult",a(Ze)],["getUA",function(){return i}],["setUA",function(e){return ir(e)&&(i=e.length>500?dr(e,500):e),this}]]).setUA(i),this}let xr,Tr,Or,Ir;Sr.VERSION="2.0.4",Sr.BROWSER=tr([He,Ge,Ke,Be]),Sr.CPU=tr([Je]),Sr.DEVICE=tr([Xe,Ye,Be,Qe,et,rt,tt,nt,st]),Sr.ENGINE=Sr.OS=tr([He,Ge]);let Cr,Nr,Er,$r=!1,Dr=null,Vr=null;const{DateTime:Mr}=r(169),_r="#sailthru-user-acquisition-email",Lr="#sailthru-user-acquisition-phone",Ur="opt-in",Fr="opt-out";function qr(){document.body?.classList?.remove("sailthru-overlay-no-scroll");const e=document.getElementsByClassName("sailthru-overlay-container");Array.from(e).forEach(e=>e.remove());const t=document.body;t?.classList?.remove("sailthru-pushdown","sailthru-pushdown-animation"),Dr?.overlay_id&&Nr.getStickyOverlayId()===Dr.overlay_id&&Nr.dismiss(Dr.overlay_id),Dr=null}function Pr(e){return/^(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){255,})(?!(?:(?:\x22?\x5C[\x00-\x7E]\x22?)|(?:\x22?[^\x5C\x22]\x22?)){65,}@)(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22))(?:\.(?:(?:[\x21\x23-\x27\x2A\x2B\x2D\x2F-\x39\x3D\x3F\x5E-\x7E]+)|(?:\x22(?:[\x01-\x08\x0B\x0C\x0E-\x1F\x21\x23-\x5B\x5D-\x7F]|(?:\x5C[\x00-\x7F]))*\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/i.test(e)}function Ar(e){const t=e.match(/sailthru(?:_\d){3}/);if(!t)return{row:null,col:null,elem:null};const[r,n,i]=t[0].match(/\d/g);return{row:r,col:n,elem:i}}function jr(e){if(!e)return console.warn("hideInputValidationError:: No selector was provided"),null;const t=document.querySelector(e);if(!t)return console.warn(`hideInputValidationError:: ${e} was not found`),null;let r=t.className;const{row:n,col:i,elem:s}=Ar(r),o=document.querySelector(`div[id$='error-${n}-${i}-${s}'].sailthru-overlay-validation-error`);return o&&(o.style.display="none"),r=r.replace(/[^\s]has-error/g,""),t.className=r,null}function zr(e){const t=document.querySelector(e).value;return t.replace(/<\/*\s*script.*?>/gi,"")}function Wr(e,t={},r={},n={}){let i=e,s="";const o=-1!==i.indexOf("?"),a=-1!==i.indexOf("#"),u=!!t.email&&encodeURIComponent(t.email);return u&&(s+=`em=${u}`),s=Object.entries(r).reduce((e,[t,r])=>{let n=e;return e&&(n+="&"),`${n}${t}=${encodeURIComponent(r)}`},s),o&&a?i=i.replace("#",`&${s}#`):o&&!a?i=`${i}&${s}`:!o&&a?i=i.replace("#",`?${s}#`):o||a||(i=`${i}?${s}`),i}function Rr(e,t,r){if(e?.redirect?.active&&e.redirect.url){const n=Wr(e.redirect.url,t,r);return e.redirect.new_tab||window.location.assign(n),qr(),`Redirecting to ${n}`}return e?.message?.active&&e.message.text?(document.getElementsByClassName("sailthru-overlay")[0].style.display="none",document.getElementsByClassName("sailthru-overlay-post-click")[0].style.display="block",setTimeout(()=>{qr()},5e3),`Display Message: ${e.message.text}`):(qr(),"No Post-click Action")}function Zr(e){const t=he.getVars(),r=e.acquisition_source||"overlay";return t.errors.length?null:{vars:{...t.vars,source:r},lists:t.lists}}function Hr(e,t,r){const n=`Invalid ${r}`;!function(e){return"function"==typeof e.checkValidity&&"function"==typeof e.setCustomValidity&&"function"==typeof e.reportValidity}(e)?(!function(e){if(!e)return console.warn("showInputValidationError:: No selector was provided"),null;const t=document.querySelector(e);if(!t)return console.warn(`hideInputValidationError:: ${e} was not found`),null;let r=t.className;const{row:n,col:i,elem:s}=Ar(r),o=document.querySelector(`div[id$='error-${n}-${i}-${s}'].sailthru-overlay-validation-error`);o&&(o.style.display="block"),r.indexOf("has-error")<0&&(r.endsWith(" ")||(r+=" "),r+="has-error"),t.className=r}(t),e.focus()):(e.setCustomValidity(n),e.reportValidity()),console.error(n)}function Br(e){const t=e.destination_lists,r={},n=document.querySelector(_r),i=!!n;let s=null;const o=document.querySelector(Lr),a=!!o;let u=null,c=null,d=!1;if(i){if(s=zr(_r),!s||!Pr(s))return Hr(n,_r,"Email"),!1;"function"==typeof n.setCustomValidity&&n.setCustomValidity(""),r.email=s}if(a&&(u=zr(Lr),d=""!==u,c=function(e){let t=e;"number"==typeof t&&(t=t.toString());let r=t.replace(/[^0-9]/g,"");return r.length<10?null:(10===r.length&&(r=`1${r}`),`+${r}`)}(u),d||!i)){if(!c)return Hr(o,Lr,"Phone"),!1;"function"==typeof o.setCustomValidity&&o.setCustomValidity(""),r.sms=c}jr(Lr),jr(_r);const h=i?"email":"sms",m=i?r.email:r.sms,f=""!==e.template,y={id:m,key:h},p={},g=document.querySelector("#sailthru-user-acquisition-sms-marketing"),w=document.querySelector("#sailthru-user-acquisition-sms-transaction");d&&g&&(p.sms_marketing_status=g.checked?Ur:Fr),d&&w&&(p.sms_transactional_status=w.checked?Ur:Fr);const v=Zr(e);if(null===v)return console.error("Required custom var missing"),!1;const{vars:b={},lists:k={}}=v??{},S=function(e,t,r){return function(n){Ir.urlFragmentParams[l]&&console.log("userSignUp SUCCESS",n),Tr.conversion(e,t);let i=-1;if("function"==typeof xr.onSignupSuccess)try{if(i=xr.onSignupSuccess({...t,vars:{...r},response:n}),0===i)return qr(),0}catch(e){console.log("onSignupSuccess encountered an error:",e),i=0}const s=Rr(e.post_click,t,r);return Ir.urlFragmentParams[l]&&console.log(`onSignupSuccess returned ${i} with post-click: ${s}`),i}}(e,r,b),x=function(e){return function(t){console.log("userSignUp ERROR",t);let r=-1;if("function"==typeof xr.onSignupError)try{r=xr.onSignupError({...e,error:t.error||"There was an error with your request"})}catch(e){console.log("onSignupError encountered an error:",e),r=0}return qr(),console.log(`onSignupError returned ${r}`),r}}(r);if(f&&r.email){const n={name:e.template,vars:{signup_lists:t}};return Or.userSignUpConfirmedOptIn(y,{keys:r,...p,vars:b,template:n,onSuccess:S,onError:x})}const T={...k};if(Array.isArray(t))for(const e of t)"string"==typeof e&&e&&(T[e]=1);return Or.userSignUp(y,{keys:r,...p,lists:T,vars:b,onSuccess:S,onError:x})}function Yr(){return"1"===Ir.urlFragmentParams.STshowOverlay}function Gr(e,t,r){try{e.setItem(t,r)}catch(n){if("QuotaExceededError"===n.name){console.error("LocalStorage is full. Making space and retrying update"),r=r.substr(1+r.indexOf("|"));try{e.setItem(t,r)}catch(e){throw console.error("Failed updating local storage"),e}}}}function Jr(e,t){const r=e.getItem("sailthru-overlay-info")||"",n=`${t}#${Mr.utc().toISO()}|`;if(-1===r.indexOf(t))Gr(e,"sailthru-overlay-info",`${r}${n}`);else{const i=r.split("|").find(e=>e.startsWith(t));Gr(e,"sailthru-overlay-info",r.replace(`${t}#${i.split("#")[1]}|`,`${n}`))}}function Kr(e,t,r,n){const i=n||window.localStorage,s=k.readCookieValue("sailthru_overlays")||"",o=function(e,t){const r=e.getItem("sailthru-overlay-info")||"";if(""===r||-1===r.indexOf(t))return null;const n=r.split("|").find(e=>e.startsWith(t));return Mr.fromISO(n.split("#")[1])}(i,r),a=Mr.utc(),u=()=>Jr(i,r);if(Yr())return!0;const l=k.handleGDPR();if(l&&"every-pageview"!==e&&"once-visit"!==e)return!1;switch(e){case"every-pageview":return!0;case"once-visit":if(!s.includes(r)){if(l){const e=k.getSessionCookieName("sailthru_overlays");return()=>k.create(e,`${r}${s}`)}return()=>k.create("sailthru_overlays",`${r}${s}`,30)}return!1;case"once-ever":{const e=i.getItem("sailthruOverlay")||"";return!e.includes(r)&&(()=>{try{i.setItem("sailthruOverlay",`${r}${e}`)}catch{i.setItem("sailthruOverlay",`${r}${e.slice(0,-36)}`)}})}case"once-month":{if(!o)return u;const e=o.plus({days:31}).setZone("utc"),t=o.plus({months:1}).endOf("month");return a>=Mr.min(t,e)&&u}case"once-week":if(!o)return u;return a.minus({days:a.weekday%7}).startOf("day")>o&&u;case"once-n-days":return(!o||a>=o.plus({days:t}))&&u;case"every-n-pageviews":{const e=function(e,t){let r=0;const n=e.getItem("sailthru-overlay-hit-count")||"";n.indexOf(t)>=0&&(r=n.split("|").find(e=>e.startsWith(t)).split("#")[1]);return Number(r)}(i,r);return k.getPageViewsCount()>=e+t&&(()=>{!function(e,t){const r=k.getPageViewsCount(),n=e.getItem("sailthru-overlay-hit-count")||"",i=`${t}#${r}|`;if(-1===n.indexOf(t))Gr(e,"sailthru-overlay-hit-count",`${n}${i}`);else{const r=n.split("|").find(e=>e.startsWith(t));Gr(e,"sailthru-overlay-hit-count",n.replace(`${t}#${r.split("#")[1]}|`,`${i}`))}}(i,r),Jr(i,r)})}default:return!1}}function Xr(){const e=new Sr(window.navigator.userAgent).getDevice().type;return"mobile"===e||"tablet"===e}function Qr(e){const t=document.querySelector("#sailthru-overlay-call-to-action"),r=document.querySelector(_r),n=document.querySelector(Lr);t&&(t.addEventListener("click",()=>{Br(e)}),r&&r.addEventListener("input",function(){const r=e.post_click;if(r?.redirect?.active&&r.redirect.new_tab&&Pr(this.value)){const n=Zr(e);if(null===n)return console.error("Required custom var missing"),!1;const{vars:i={},lists:s={}}=n??{},o={email:zr(_r)};Cr=Wr(r.redirect.url,o,i),t.href=Cr,t.target="_blank"}else t.removeAttribute("href"),t.removeAttribute("target")})),r&&r.addEventListener("keydown",e=>{jr(_r);13===(e.which||e.keyCode)&&document.querySelector("#sailthru-overlay-call-to-action").click()}),n&&n.addEventListener("keydown",e=>{jr(Lr);13===(e.which||e.keyCode)&&document.querySelector("#sailthru-overlay-call-to-action").click()})}function en(){!function(e,t){const r=document.querySelector(`.${e}`);r&&t.addEventListener("mousedown",e=>{r.contains(e.target)||qr()})}("sailthru-overlay",document.getElementById("sailthru-overlay-container"))}function tn(e,t){if(Dr)return;Dr=e;const r=document.getElementsByClassName("sailthru-overlay");for(let e=r.length-1;e>=0;e-=1)try{document.body.removeChild(r[e])}catch{}!function(e){const t=new window.DOMParser;document.body.appendChild(t.parseFromString(e,"text/html").body.firstChild)}(e.html),document.body?.classList?.add("sailthru-overlay-no-scroll"),!1===e.allow_close?function(){const e=document.querySelector(".sailthru-overlay-post-click");e&&(e.querySelectorAll(".sailthru-overlay-close").forEach(e=>e.addEventListener("click",qr)),document.addEventListener("keydown",function(t){"Escape"!==t.key&&27!==t.keyCode||"none"===window.getComputedStyle(e).display||qr()},{once:!0}))}():(document.querySelectorAll(".sailthru-overlay-close").forEach(e=>e.addEventListener("click",qr)),document.addEventListener("keydown",e=>{"Escape"!==e.key&&27!==e.keyCode||qr()})),e&&!0===e.click_to_dismiss&&en(),function(e){const t=document.getElementById("sailthru-overlay-container").getElementsByTagName("a"),r=()=>{Tr.click(e),qr()};for(let e=0,n=t.length;e{if(window.navigator.userAgent.indexOf("Trident")<0)return;const e=document.getElementsByClassName("sailthru-overlay")[0],t=window.getComputedStyle(e,null)["background-image"];t&&(e.style["background-image"]=t,u&&console.log(`Setting background-image to ${t}.`));const r=window.getComputedStyle(e,null).height;u&&console.log(`Setting height to ${r}.`),e.style.height=r};h(),u&&console.log(`Scheduling inline CSS resets after ${d} ms.`),setTimeout(h,d)}function rn(e){if(!function(e){const t=Xr();return"mobile-only"===e?t:"desktop-only"!==e||!t}(e.target_device))return!1;const t=Number(e.frequency_value),r=Kr(e.frequency,isNaN(t)?0:t,e.overlay_id);if(!r)return!1;const{onBeforeOverlayRender:n}=xr;if("function"==typeof n)try{if(!1===n(e))return!1}catch(e){console.log("Unexpected error in onBeforeOverlayRender function.",e)}return"function"==typeof r&&r(),!e.renderhref||e.renderhref===document.location.href}function nn(e,t){($r||rn(e))&&tn(e,t)}function sn(e){if(e.exit_intent){const t=(e=>{Vr=e;const t=r=>{r.clientY>20||Vr!==e||nn(e,t)};return t})(e);document.documentElement.addEventListener("mouseleave",t)}else e.timer?Er.renderTimeDelayedOverlay(e):nn(e);return e}function on(e){const t={};return Object.keys(e).forEach(r=>{if("renderhref"!==r){const n=e[r];e.renderhref&&n&&(n.renderhref=e.renderhref),sn(n),t[r]=n}}),t}function an(){let e=[];const t=Ir.getPreviewIdFromAnchor();t&&(console.log(`previewing overlay ${t}`),e.push(`preview=${t}`));const r=function(){const e=window.location.hash.startsWith("#")?window.location.hash.substring(1):window.location.hash,t="1"===new URLSearchParams(e).get(d);return t&&console.log(`Overriding pageviews count with anchor "${d}=1".`),t}()?"10000":k.readCookieValue("sailthru_pageviews");r&&e.push(`pageviews=${r}`);const n=Xr()?"1":"0";e.push(`isMobile=${n}`);const i=Nr.triggerStickyOverlay();i&&e.push(`echo=${i}`),e=Ir.pushLandingPageParams(e);for(const t of function(){const e=k.readCookieValue("sailthru_overlays");return me.parseUuidsList(e)}())e.push(`so=${t}`);for(const t of function(e){const t=(e||window.localStorage).getItem("sailthruOverlay");return me.parseUuidsList(t)}())e.push(`oo=${t}`);if(xr.overlayKeyValue&&"object"==typeof xr.overlayKeyValue){const t={};for(const e of Object.keys(xr.overlayKeyValue))"string"==typeof xr.overlayKeyValue[e]?t[e]=xr.overlayKeyValue[e]:console.warn(`Value provided for custom overlay targeting key ${e} is of type ${typeof xr.overlayKeyValue[e]} and will be ignored. Values used for custom overlay targeting must be of string type only.`);e.push(`okv=${encodeURIComponent(JSON.stringify(t))}`)}return e}function un(){const e=`${xr.personalizeDomain}/v1/personalize/initialize?`;let t=an();return t=Ir.pushUserIdKeyAndUserIdValue(xr,t),Promise.resolve(e+t.join("&"))}function ln(){return Ir.isPreview()&&($r=!0),$r}const cn=e=>(xr=e,Tr=ge(xr),Or=Q(xr),Ir=q(),Nr=Te(),Er=Ve(nn),{hideOverlay:qr,buildOverlayUrl:un,renderOverlays:on,renderOverlay:sn,isShowOverlaySet:Yr,setPreview:ln,getUrlParameters:an});let dn,hn,mn,fn,yn;function pn(e){const{selector:t,sectionId:r}=e,n=document.querySelectorAll(`${t}`)[0];n&&n.addEventListener("click",t=>{t.preventDefault();const n=t.target,i=n.closest("a");if("A"===n.tagName||i){const t=n.getAttribute("href")||i.getAttribute("href");hn.click(r,t,{onSuccess:r=>{k.updatePCCookie(r,e),window.location.href=t},onError:e=>{console.error(`Click error: ${e.error}`),window.location.href=t}}).catch(e=>{console.error(`Error: ${e}`),window.location.href=t})}})}function gn(e){dn.impressions[e]&&delete dn.impressions[e]}function wn(e){gn(e.elementId)}function vn(e){const{elementId:t}=e,r=dn.impressions[t];if(r){if(r.failures+=1,r.failures>=5)gn(t);else{const{section:{sectionId:e},urls:n}=r;hn.impression(e,n,{sectionId:e,elementId:t,userIdKey:dn.userIdKey,userIdValue:dn.userIdValue,onSuccess:wn,onError:vn})}return r}}function bn(){const{impressions:e}=dn;Object.keys(e).forEach(t=>{const r=e[t];if(function(e){const t=document.querySelector(e);if(!t)return!1;const r=t.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight;return!(r.right<0||r.bottom<0||r.left>n||r.top>i)}(t)&&"unseen"===r.status){const{section:{sectionId:e},urls:n}=r;return r.status="seen",hn.impression(e,n,{elementId:t,userIdKey:dn.userIdKey,userIdValue:dn.userIdValue,onSuccess:wn,onError:vn}),r}})}function kn(e){const{selector:t}=e,r=[],n=document.querySelectorAll(`${t} a[href]`);for(const e of n)r.push(e.href);return dn.impressions[t]={section:e,urls:r,failures:0,status:"unseen"},window.addEventListener("scroll",bn),bn()}function Sn(e){const{sectionId:t,selector:r,list:n,json:i,html:s,error:o,errorMessage:a}=e;if(o)return{error:o};if(a)return{errorMessage:a};const u={sectionId:t,selector:r,list:n};return i?u.json=i:s&&(u.html=s),u}function xn(e){const{selector:t,html:r}=e,n=document.querySelectorAll(t);if(n.length>0)for(const e of n){const t=e.cloneNode(!1);t.innerHTML=r,e.parentNode.replaceChild(t,e)}else console.error(`Unknown selector '${t}' for section ${e.sectionId}`)}function Tn(e,t){return"function"==typeof t?t(e):dn&&"function"==typeof dn.onError?dn.onError(e):console.error(`Personalize call failed. ${e}`)}function On(e,t){const{testId:r,customerId:n,sections:s={},overlays:o={}}=e,a=e.doNotTrack;if(void 0!==r&&(k.delete("sailthru_test_id"),k.create("sailthru_test_id",r,525600)),void 0!==e.pageview){const t=e.pageview.error||e.pageview.message,r=e.pageview.contentHash,n=e.pageview.visitorId;void 0!==t?console.error(`Pageview error ${t}`):(k.updateSailthruContentCookie(r),n&&!k.handleGDPR()&&(k.delete("sailthru_visitor"),k.create("sailthru_visitor",n,525600)))}if(dn.customerId=n||dn.customerId,dn.sections=function(e){const{requestedSections:t}=dn;for(const r in e){const n=e[r],i=t[n.requestedSectionId],s=void 0!==i;n.sectionId=r,dn.isCustom&&(n.selector=i.selector||""),n.html&&!n.control&&xn(n),n.selector&&(kn(n),pn(n)),e[r]=Sn(n),n.error||n.errorMessage?s&&"function"==typeof i.onError&&i.onError(e[r]):s&&"function"==typeof i.onSuccess&&i.onSuccess(e[r])}return e}(s),mn.setPreview()){const e=Object.keys(o)[0];void 0!==e?dn.overlay=mn.renderOverlay(o[e]):console.warn("No overlay to preview. put a valid overlay id!")}else e.renderhref&&(o.renderhref=e.renderhref),dn.overlay=mn.renderOverlays(o);a&&(k.setSailthruHid(i),k.handleGDPR()),"function"==typeof t&&t(dn.sections),"function"==typeof dn.onSuccess&&dn.onSuccess(dn.sections)}function In(e=!1){let t=window.location.toString();if(t&&!e){const e=t.indexOf("#");e>=0&&(t=t.slice(0,e))}return t}window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){let t,r=(this.document||this.ownerDocument).querySelectorAll(e),n=this;do{for(t=r.length;--t>=0&&r.item(t)!==n;);}while(t<0&&(n=n.parentElement));return n});const Cn=e=>(dn=e,mn=cn(dn),hn=T(dn),fn=q(),yn=Te(),{fetchPersonalize(e,t,r={}){if(!t)throw Error("Missing referrerUrl from personalize call");const n=new Headers({Accept:"application/json","Content-Type":"application/json","X-Lib-Version":dn.VERSION,Authorization:`Bearer ${dn.customerId}`,"X-Referring-URL":In(dn.fragmentEnabled)});return x(e,{credentials:"same-origin",headers:n},3e4).then(e=>function(e,t){if(window.location!=t)throw fn.urlFragmentParams[l]&&(console.log("window.location",window.location),console.log("referrerUrl",t)),Error("Response for different page.");if(!e)throw Error("No personalize response.");return e.json()}(e,t)).then(e=>e&&(e.error||e.message)?Tn(e,r.onError):(e.customerId&&""!=e.customerId&&dn&&dn.currhref&&(e.renderhref=dn.currhref),On(e,r.onSuccess))).catch(e=>Tn(e,r.onError))},SPAHistoryHook(){!function(e){const t=e.pushState;e.pushState=function(r,n,i){const s=t.apply(e,arguments);return Sailthru.init(dn),s}}(window.history)}});let Nn,En,$n,Dn;function Vn(e){let t=`${Nn.personalizeDomain}/v1/personalize`,r=[];if(e)t+="?",r.push(`sections=${Object.keys(Nn.requestedSections).join()}`),Nn.userVars&&r.push(`vars=${encodeURIComponent(JSON.stringify(Nn.userVars))}`);else{t+="/simple?",r=En.getUrlParameters();const e=k.read("sailthru_visitor");e&&r.push(`visitorId=${e}`);const n=k.read("sailthru_bid");n&&r.push(`messageId=${n}`)}r=Dn.pushUserIdKeyAndUserIdValue(Nn,r);const n=k.read("sailthru_content");n&&r.push(`content=${n}`);const i=k.read("sailthru_test_id");return i&&r.push(`testId=${i}`),Nn.checkBlocked?(s=Nn.assetsPath,fetch(`${s}awepop.js`,{mode:"no-cors"}).then(()=>!1).catch(e=>"Failed to fetch"===e.message)).then(e=>(e&&r.push("blocked=true"),t+r.join("&"))):Promise.resolve(t+r.join("&"));var s}function Mn(e){const{sections:t,onSuccess:r,onError:n}=e,i={onSuccess:r,onError:n,sections:t};if(!t||!t.length)throw Error("Please add sections before personalize");return e&&e.vars&&(Nn.userVars={vars:e.vars}),t.forEach(e=>{Nn.requestedSections[e.id]={...e}}),Vn(!0).then(e=>$n.fetchPersonalize(e,window.location,i))}const _n=e=>(Nn=e,En=cn(Nn),$n=Cn(Nn),Dn=q(),{personalize:Mn,buildPersonalizeUrl:Vn,overlay:En}),{debug:Ln,init:Un,personalize:Fn,track:qn,integration:Pn,overlay:An}=(e=>{let t,r,n,i,s,o,a,u,l,c,d,h,m,f,y,p,g,w={};return{debug:()=>({...w}),init({userIdKey:v="hid",checkBlocked:b=!1,isCustom:S=!1,autoTrackPageview:x=!0,excludeContent:O=!1,useStoredTags:I=!0,customerId:C,fragmentEnabled:N=!1,onSuccess:E,onError:$,onSignupSuccess:D,onSignupError:V,onBeforeOverlayRender:M,overlayKeyValue:_,hostWebsiteType:L}={}){if(w={VERSION:"v1.0.1",...e,isCustom:S,userIdKey:v,checkBlocked:b,customerId:C,fragmentEnabled:N,overlays:{},sections:{},requestedSections:{},impressions:{},cleanJSON:[],autoTrackPageview:x,excludeContent:O,useStoredTags:I,onSuccess:E,onError:$,onSignupSuccess:D,onSignupError:V,onBeforeOverlayRender:M,overlayKeyValue:_},w.currhref=document.location.href,void 0===w.customerId)throw Error("Customer ID is required.");k.refreshNoCookies(),k.handleGDPR();const U=Cn(w);L&&"spa"===L.toLowerCase()&&U.SPAHistoryHook(),t=U.fetchPersonalize;const F=T(w);r=F.click,n=F.impression,i=F.pageview,f=F.gdprDoNotTrack,y=F.cookiesDoNotTrack;const q=X(w);s=q.appendHearbeatListener;const P=Q(w);o=P.getCurrentUser,a=P.userSignUp,u=P.userSignUpConfirmedOptIn,l=P.addToCart,c=P.purchase,d=P.customEvent,p=P.watchContent;const A=Te();g=A.dismiss,h=_n(w),m=cn(w),k.updatePageviewsCookie();const j=window.localStorage;return 1===k.getPageViewsCount()&&j.removeItem("sailthru-overlay-hit-count"),m.hideOverlay(),S?(x&&i(window.location.href),m.buildOverlayUrl().then(e=>t(e,window.location))):h.buildPersonalizeUrl(!1).then(e=>t(e,window.location)).then(()=>{k.isDoNotTrackUser()||s()})},personalize:e=>(k.handleGDPR(),h.personalize(e)),track(e,t){const o={...t},{sectionId:a,url:u,urls:l}=o,c=`Invalid event: ${e}. Please specify a valid event.`;switch(delete o.sectionId,delete o.url,delete o.urls,delete o.email,delete o.name,delete o.id,delete o.key,k.handleGDPR(),e){case"click":return r(a,u,o);case"impression":return n(a,l,o);case"pageview":return i(u,o).then(()=>{k.isDoNotTrackUser()||s()});case"gdprDoNotTrack":return f(e);case"cookiesDoNotTrack":return y(t);default:return console.error(c),c}},integration(e,t){const r={...t},{email:n,name:i,id:s,key:h="email"}=r,m={id:s||n,key:h},f=`Invalid event: ${e}. Please specify a valid event.`;switch(delete r.sectionId,delete r.url,delete r.urls,delete r.email,delete r.name,delete r.id,delete r.key,k.handleGDPR(),e){case"getCurrentUser":return o(r);case"userSignUp":return a(m,r);case"userSignUpConfirmedOptIn":return u(m,r);case"addToCart":return l(m,r);case"purchase":return c(m,r);case"watchContent":return p(m,r);case"customEvent":return d(i,m,r);default:return console.error(f),f}},overlay(e,t={}){const r=`Invalid event: ${e}. Please specify a valid event.`,{overlayId:n}=t;switch(e){case"dismiss":return g(n);case"hide":return m.hideOverlay();default:return console.error(r),r}}}})({trackDomain:"https://api.sail-track.com",personalizeDomain:"https://api.sail-personalize.com",overlayTrackDomain:"https://overlay-track.sailthru.cloud",assetsPath:"https://ak.sail-horizon.com/spm/",enableHeartbeat:!0}),jn=m.getCookie;return n})()); //# sourceMappingURL=spm.v1.min.js.map